adc: exynos_adc: Convert to devm_ioremap_resource()
authorSachin Kamat <sachin.kamat@linaro.org>
Wed, 3 Apr 2013 06:23:00 +0000 (07:23 +0100)
committerJonathan Cameron <jic23@kernel.org>
Wed, 22 May 2013 21:18:22 +0000 (22:18 +0100)
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/exynos_adc.c

index 9f3a8ef1fb3e4484bcbc027337ce75a3f6e13425..22d034a55a625f5c08add9bac8f83980c3214b30 100644 (file)
@@ -270,16 +270,16 @@ static int exynos_adc_probe(struct platform_device *pdev)
        info = iio_priv(indio_dev);
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       info->regs = devm_request_and_ioremap(&pdev->dev, mem);
-       if (!info->regs) {
-               ret = -ENOMEM;
+       info->regs = devm_ioremap_resource(&pdev->dev, mem);
+       if (IS_ERR(info->regs)) {
+               ret = PTR_ERR(info->regs);
                goto err_iio;
        }
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-       info->enable_reg = devm_request_and_ioremap(&pdev->dev, mem);
-       if (!info->enable_reg) {
-               ret = -ENOMEM;
+       info->enable_reg = devm_ioremap_resource(&pdev->dev, mem);
+       if (IS_ERR(info->enable_reg)) {
+               ret = PTR_ERR(info->enable_reg);
                goto err_iio;
        }