pwm: Convert to devm_ioremap_resource()
authorThierry Reding <thierry.reding@avionic-design.de>
Mon, 21 Jan 2013 10:09:16 +0000 (11:09 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Jan 2013 19:41:57 +0000 (11:41 -0800)
Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pwm/pwm-imx.c
drivers/pwm/pwm-lpc32xx.c
drivers/pwm/pwm-mxs.c
drivers/pwm/pwm-puv3.c
drivers/pwm/pwm-pxa.c
drivers/pwm/pwm-spear.c
drivers/pwm/pwm-tegra.c
drivers/pwm/pwm-tiecap.c
drivers/pwm/pwm-tiehrpwm.c
drivers/pwm/pwm-tipwmss.c
drivers/pwm/pwm-vt8500.c

index 65a86bd..3f5677b 100644 (file)
@@ -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;
index 1410644..b3f0d0d 100644 (file)
@@ -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))
index 7ec345f..a53d309 100644 (file)
@@ -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))
index b882f60..db964e6 100644 (file)
@@ -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;
index f32fc4e..20370e6 100644 (file)
@@ -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) {
index 83b21d9..69a2d9e 100644 (file)
@@ -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))
index 30c0e2b..71900e8 100644 (file)
@@ -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);
 
index 5cf016d..27a67d6 100644 (file)
@@ -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) {
index 72a6dd4..5a13995 100644 (file)
@@ -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");
index 3448a1c..17cbc59 100644 (file)
@@ -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);
index b0ba2d4..f9de9b2 100644 (file)
@@ -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) {