diff --git a/drivers/pwm/pwm-imx.c b/drivers/pwm/pwm-imx.c index 65a86bdeabedbdfdf35ff66f976cda00114a09a9..3f5677b7690e5c3f8332fde97fa3a62a82fe4a57 100644 --- a/drivers/pwm/pwm-imx.c +++ b/drivers/pwm/pwm-imx.c @@ -274,9 +274,9 @@ static int imx_pwm_probe(struct platform_device *pdev) return -ENODEV; } - imx->mmio_base = devm_request_and_ioremap(&pdev->dev, r); - if (imx->mmio_base == NULL) - return -EADDRNOTAVAIL; + imx->mmio_base = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(imx->mmio_base)) + return PTR_ERR(imx->mmio_base); data = of_id->data; imx->config = data->config; diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers/pwm/pwm-lpc32xx.c index 14106440294fa94fd468563f4bed1212d6f356fe..b3f0d0dfd74808ff9469f72a0f371bca7ebd85be 100644 --- a/drivers/pwm/pwm-lpc32xx.c +++ b/drivers/pwm/pwm-lpc32xx.c @@ -110,9 +110,9 @@ static int lpc32xx_pwm_probe(struct platform_device *pdev) if (!res) return -EINVAL; - lpc32xx->base = devm_request_and_ioremap(&pdev->dev, res); - if (!lpc32xx->base) - return -EADDRNOTAVAIL; + lpc32xx->base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(lpc32xx->base)) + return PTR_ERR(lpc32xx->base); lpc32xx->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(lpc32xx->clk)) diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c index 7ec345f01831cf216732236709b3b00be603a780..a53d3094b75ac553967d513c585b185fca8d7583 100644 --- a/drivers/pwm/pwm-mxs.c +++ b/drivers/pwm/pwm-mxs.c @@ -139,9 +139,9 @@ static int mxs_pwm_probe(struct platform_device *pdev) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mxs->base = devm_request_and_ioremap(&pdev->dev, res); - if (!mxs->base) - return -EADDRNOTAVAIL; + mxs->base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(mxs->base)) + return PTR_ERR(mxs->base); pinctrl = devm_pinctrl_get_select_default(&pdev->dev); if (IS_ERR(pinctrl)) diff --git a/drivers/pwm/pwm-puv3.c b/drivers/pwm/pwm-puv3.c index b882f6032feed55e2e9236c5264522ff6bd393bf..db964e6ecf5cfe9c2bed63044ce2db997c2dbdf6 100644 --- a/drivers/pwm/pwm-puv3.c +++ b/drivers/pwm/pwm-puv3.c @@ -123,9 +123,9 @@ static int pwm_probe(struct platform_device *pdev) return -ENODEV; } - puv3->base = devm_request_and_ioremap(&pdev->dev, r); - if (puv3->base == NULL) - return -EADDRNOTAVAIL; + puv3->base = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(puv3->base)) + return PTR_ERR(puv3->base); puv3->chip.dev = &pdev->dev; puv3->chip.ops = &puv3_pwm_ops; diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c index f32fc4e66e0c96675b4edaae9a545f9e065ad72e..20370e61de5a2701df605fe2219cbafa6822512e 100644 --- a/drivers/pwm/pwm-pxa.c +++ b/drivers/pwm/pwm-pxa.c @@ -165,9 +165,9 @@ static int pwm_probe(struct platform_device *pdev) return -ENODEV; } - pwm->mmio_base = devm_request_and_ioremap(&pdev->dev, r); - if (pwm->mmio_base == NULL) - return -EADDRNOTAVAIL; + pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(pwm->mmio_base)) + return PTR_ERR(pwm->mmio_base); ret = pwmchip_add(&pwm->chip); if (ret < 0) { diff --git a/drivers/pwm/pwm-spear.c b/drivers/pwm/pwm-spear.c index 83b21d9d5cf900e3e9ddde7ea4784fb6c6202c64..69a2d9eb34db01d7efdb468ef061ee70727c0f6b 100644 --- a/drivers/pwm/pwm-spear.c +++ b/drivers/pwm/pwm-spear.c @@ -192,9 +192,9 @@ static int spear_pwm_probe(struct platform_device *pdev) return -ENOMEM; } - pc->mmio_base = devm_request_and_ioremap(&pdev->dev, r); - if (!pc->mmio_base) - return -EADDRNOTAVAIL; + pc->mmio_base = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(pc->mmio_base)) + return PTR_ERR(pc->mmio_base); pc->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(pc->clk)) diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c index 30c0e2b70ce8bf4127cb22cb827f2e266e6950a4..71900e8cd3d1f6063de1a904a58236e9a8406ee3 100644 --- a/drivers/pwm/pwm-tegra.c +++ b/drivers/pwm/pwm-tegra.c @@ -186,9 +186,9 @@ static int tegra_pwm_probe(struct platform_device *pdev) return -ENODEV; } - pwm->mmio_base = devm_request_and_ioremap(&pdev->dev, r); - if (!pwm->mmio_base) - return -EADDRNOTAVAIL; + pwm->mmio_base = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(pwm->mmio_base)) + return PTR_ERR(pwm->mmio_base); platform_set_drvdata(pdev, pwm); diff --git a/drivers/pwm/pwm-tiecap.c b/drivers/pwm/pwm-tiecap.c index 5cf016dd982238f4dac9ba5e4da12194d0e614aa..27a67d6b27c193ba2b46ee7b1debc47e1f833672 100644 --- a/drivers/pwm/pwm-tiecap.c +++ b/drivers/pwm/pwm-tiecap.c @@ -238,9 +238,9 @@ static int ecap_pwm_probe(struct platform_device *pdev) return -ENODEV; } - pc->mmio_base = devm_request_and_ioremap(&pdev->dev, r); - if (!pc->mmio_base) - return -EADDRNOTAVAIL; + pc->mmio_base = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(pc->mmio_base)) + return PTR_ERR(pc->mmio_base); ret = pwmchip_add(&pc->chip); if (ret < 0) { diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c index 72a6dd40c9ec5a566ccdffaffe69d8d4cc13f0af..5a13995805335f322bad067c4e885e1777e87564 100644 --- a/drivers/pwm/pwm-tiehrpwm.c +++ b/drivers/pwm/pwm-tiehrpwm.c @@ -453,9 +453,9 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev) return -ENODEV; } - pc->mmio_base = devm_request_and_ioremap(&pdev->dev, r); - if (!pc->mmio_base) - return -EADDRNOTAVAIL; + pc->mmio_base = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(pc->mmio_base)) + return PTR_ERR(pc->mmio_base); /* Acquire tbclk for Time Base EHRPWM submodule */ pc->tbclk = devm_clk_get(&pdev->dev, "tbclk"); diff --git a/drivers/pwm/pwm-tipwmss.c b/drivers/pwm/pwm-tipwmss.c index 3448a1c88590653ddad14681cac45dcd5e37034c..17cbc59660ec44fc2f1e31f51414d5fe43fd186c 100644 --- a/drivers/pwm/pwm-tipwmss.c +++ b/drivers/pwm/pwm-tipwmss.c @@ -75,9 +75,9 @@ static int pwmss_probe(struct platform_device *pdev) return -ENODEV; } - info->mmio_base = devm_request_and_ioremap(&pdev->dev, r); - if (!info->mmio_base) - return -EADDRNOTAVAIL; + info->mmio_base = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(info->mmio_base)) + return PTR_ERR(info->mmio_base); pm_runtime_enable(&pdev->dev); pm_runtime_get_sync(&pdev->dev); diff --git a/drivers/pwm/pwm-vt8500.c b/drivers/pwm/pwm-vt8500.c index b0ba2d403439b0a77b889f88cb210f0eaae789ad..f9de9b28e46e04121a8e7d42b36f6f613b11a228 100644 --- a/drivers/pwm/pwm-vt8500.c +++ b/drivers/pwm/pwm-vt8500.c @@ -178,9 +178,9 @@ static int vt8500_pwm_probe(struct platform_device *pdev) return -ENODEV; } - chip->base = devm_request_and_ioremap(&pdev->dev, r); - if (!chip->base) - return -EADDRNOTAVAIL; + chip->base = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(chip->base)) + return PTR_ERR(chip->base); ret = clk_prepare(chip->clk); if (ret < 0) {