]> git.karo-electronics.de Git - linux-beck.git/commitdiff
gpio: pl061: Use devm_ioremap_resource()
authorJingoo Han <jg1.han@samsung.com>
Wed, 12 Feb 2014 02:53:58 +0000 (11:53 +0900)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 24 Feb 2014 12:15:28 +0000 (13:15 +0100)
Use devm_ioremap_resource() in order to make the code simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-pl061.c

index 062a1be7492944a5b97bed2696302ff03df2693e..e528cb2b12aaa62fbb87573d82cd5a96e50f2635 100644 (file)
@@ -302,18 +302,9 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
                irq_base = 0;
        }
 
-       if (!devm_request_mem_region(dev, adev->res.start,
-                                    resource_size(&adev->res), "pl061")) {
-               dev_err(&adev->dev, "no memory region\n");
-               return -EBUSY;
-       }
-
-       chip->base = devm_ioremap(dev, adev->res.start,
-                                 resource_size(&adev->res));
-       if (!chip->base) {
-               dev_err(&adev->dev, "could not remap memory\n");
-               return -ENOMEM;
-       }
+       chip->base = devm_ioremap_resource(dev, &adev->res);
+       if (IS_ERR(chip->base))
+               return PTR_ERR(chip->base);
 
        spin_lock_init(&chip->lock);