diff options
author | Jingoo Han <jg1.han@samsung.com> | 2014-02-12 02:53:58 (GMT) |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-02-24 12:15:28 (GMT) |
commit | 09bafc30b6fea0b374ac4ff0b8e923c07f5cda78 (patch) | |
tree | f064121ad7b6f05000e47fe4eea06ca46ae053c5 /drivers/gpio/gpio-pl061.c | |
parent | 2b1f597f7f40f8f289489eaa1a973254afc2a632 (diff) | |
download | linux-09bafc30b6fea0b374ac4ff0b8e923c07f5cda78.tar.xz |
gpio: pl061: Use devm_ioremap_resource()
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>
Diffstat (limited to 'drivers/gpio/gpio-pl061.c')
-rw-r--r-- | drivers/gpio/gpio-pl061.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 062a1be..e528cb2 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c @@ -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); |