| .. | .. |
|---|
| 1042 | 1042 | platform_set_drvdata(pdev, pinctrl); |
|---|
| 1043 | 1043 | spin_lock_init(&pinctrl->lock); |
|---|
| 1044 | 1044 | |
|---|
| 1045 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 1046 | | - pinctrl->base0 = devm_ioremap_resource(&pdev->dev, res); |
|---|
| 1045 | + pinctrl->base0 = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 1047 | 1046 | if (IS_ERR(pinctrl->base0)) |
|---|
| 1048 | 1047 | return PTR_ERR(pinctrl->base0); |
|---|
| 1049 | 1048 | |
|---|
| 1050 | 1049 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
|---|
| 1051 | | - pinctrl->base1 = devm_ioremap_nocache(&pdev->dev, res->start, |
|---|
| 1050 | + if (!res) |
|---|
| 1051 | + return -EINVAL; |
|---|
| 1052 | + pinctrl->base1 = devm_ioremap(&pdev->dev, res->start, |
|---|
| 1052 | 1053 | resource_size(res)); |
|---|
| 1053 | 1054 | if (!pinctrl->base1) { |
|---|
| 1054 | 1055 | dev_err(&pdev->dev, "unable to map I/O space\n"); |
|---|
| 1055 | 1056 | return -ENOMEM; |
|---|
| 1056 | 1057 | } |
|---|
| 1057 | 1058 | |
|---|
| 1058 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 2); |
|---|
| 1059 | | - pinctrl->pinconf_base = devm_ioremap_resource(&pdev->dev, res); |
|---|
| 1059 | + pinctrl->pinconf_base = devm_platform_ioremap_resource(pdev, 2); |
|---|
| 1060 | 1060 | if (IS_ERR(pinctrl->pinconf_base)) |
|---|
| 1061 | 1061 | return PTR_ERR(pinctrl->pinconf_base); |
|---|
| 1062 | 1062 | |
|---|