summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-pxa.c
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2015-11-28 22:37:43 +0100
committerLinus Walleij <linus.walleij@linaro.org>2015-12-10 16:04:40 +0100
commit8852b2f7dbf69544fb2ea65896405e11d930e132 (patch)
tree804b95255c2babedefb93abc0f76d9a29cc024e5 /drivers/gpio/gpio-pxa.c
parentfc0589ca64786a2ade9f916fc9c7ca95d375c182 (diff)
downloadlinux-8852b2f7dbf69544fb2ea65896405e11d930e132.tar.gz
gpio: pxa: convert to devm_ioremap
Use the device managed ioremap to simplify the probe function. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-pxa.c')
-rw-r--r--drivers/gpio/gpio-pxa.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index 540b2115f741..69916c65f094 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -614,9 +614,8 @@ static int pxa_gpio_probe(struct platform_device *pdev)
|| (irq_mux <= 0))
return -EINVAL;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -EINVAL;
- gpio_reg_base = ioremap(res->start, resource_size(res));
+ gpio_reg_base = devm_ioremap(&pdev->dev, res->start,
+ resource_size(res));
if (!gpio_reg_base)
return -EINVAL;
@@ -627,13 +626,11 @@ static int pxa_gpio_probe(struct platform_device *pdev)
if (IS_ERR(clk)) {
dev_err(&pdev->dev, "Error %ld to get gpio clock\n",
PTR_ERR(clk));
- iounmap(gpio_reg_base);
return PTR_ERR(clk);
}
ret = clk_prepare_enable(clk);
if (ret) {
clk_put(clk);
- iounmap(gpio_reg_base);
return ret;
}