mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-18 19:27:13 +00:00
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>
This commit is contained in:
parent
fc0589ca64
commit
8852b2f7db
@ -614,9 +614,8 @@ static int pxa_gpio_probe(struct platform_device *pdev)
|
|||||||
|| (irq_mux <= 0))
|
|| (irq_mux <= 0))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
if (!res)
|
gpio_reg_base = devm_ioremap(&pdev->dev, res->start,
|
||||||
return -EINVAL;
|
resource_size(res));
|
||||||
gpio_reg_base = ioremap(res->start, resource_size(res));
|
|
||||||
if (!gpio_reg_base)
|
if (!gpio_reg_base)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@ -627,13 +626,11 @@ static int pxa_gpio_probe(struct platform_device *pdev)
|
|||||||
if (IS_ERR(clk)) {
|
if (IS_ERR(clk)) {
|
||||||
dev_err(&pdev->dev, "Error %ld to get gpio clock\n",
|
dev_err(&pdev->dev, "Error %ld to get gpio clock\n",
|
||||||
PTR_ERR(clk));
|
PTR_ERR(clk));
|
||||||
iounmap(gpio_reg_base);
|
|
||||||
return PTR_ERR(clk);
|
return PTR_ERR(clk);
|
||||||
}
|
}
|
||||||
ret = clk_prepare_enable(clk);
|
ret = clk_prepare_enable(clk);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
clk_put(clk);
|
clk_put(clk);
|
||||||
iounmap(gpio_reg_base);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user