Commit e2bddc6a authored by Boris BREZILLON's avatar Boris BREZILLON Committed by Linus Walleij

pinctrl: sunxi: disable clk when failing to probe pin controller

Disable the clk when failing to probe the pin controller device.
Signed-off-by: default avatarBoris BREZILLON <boris.brezillon@free-electrons.com>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 6415093f
...@@ -891,7 +891,7 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev) ...@@ -891,7 +891,7 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
pctl->irq = irq_of_parse_and_map(node, 0); pctl->irq = irq_of_parse_and_map(node, 0);
if (!pctl->irq) { if (!pctl->irq) {
ret = -EINVAL; ret = -EINVAL;
goto gpiochip_error; goto clk_error;
} }
pctl->domain = irq_domain_add_linear(node, SUNXI_IRQ_NUMBER, pctl->domain = irq_domain_add_linear(node, SUNXI_IRQ_NUMBER,
...@@ -899,7 +899,7 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev) ...@@ -899,7 +899,7 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
if (!pctl->domain) { if (!pctl->domain) {
dev_err(&pdev->dev, "Couldn't register IRQ domain\n"); dev_err(&pdev->dev, "Couldn't register IRQ domain\n");
ret = -ENOMEM; ret = -ENOMEM;
goto gpiochip_error; goto clk_error;
} }
for (i = 0; i < SUNXI_IRQ_NUMBER; i++) { for (i = 0; i < SUNXI_IRQ_NUMBER; i++) {
...@@ -917,6 +917,8 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev) ...@@ -917,6 +917,8 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
return 0; return 0;
clk_error:
clk_disable_unprepare(clk);
gpiochip_error: gpiochip_error:
if (gpiochip_remove(pctl->chip)) if (gpiochip_remove(pctl->chip))
dev_err(&pdev->dev, "failed to remove gpio chip\n"); dev_err(&pdev->dev, "failed to remove gpio chip\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment