diff options
author | Boris BREZILLON <boris.brezillon@free-electrons.com> | 2014-04-10 15:52:41 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-04-22 13:40:05 +0200 |
commit | e2bddc6a7d69d533dd0f33d5ecc04ef70914abba (patch) | |
tree | 7ec49a5c732c339065fbe04adfbc12e4b10a93be /drivers/pinctrl/pinctrl-sunxi.c | |
parent | 6415093f7f643ba73518f83a3c07f32aeadb0317 (diff) |
pinctrl: sunxi: disable clk when failing to probe pin controller
Disable the clk when failing to probe the pin controller device.
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-sunxi.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-sunxi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c index 2d9ca1cf6daf..73d11e2fb18f 100644 --- a/drivers/pinctrl/pinctrl-sunxi.c +++ b/drivers/pinctrl/pinctrl-sunxi.c @@ -891,7 +891,7 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev) pctl->irq = irq_of_parse_and_map(node, 0); if (!pctl->irq) { ret = -EINVAL; - goto gpiochip_error; + goto clk_error; } pctl->domain = irq_domain_add_linear(node, SUNXI_IRQ_NUMBER, @@ -899,7 +899,7 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev) if (!pctl->domain) { dev_err(&pdev->dev, "Couldn't register IRQ domain\n"); ret = -ENOMEM; - goto gpiochip_error; + goto clk_error; } for (i = 0; i < SUNXI_IRQ_NUMBER; i++) { @@ -917,6 +917,8 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev) return 0; +clk_error: + clk_disable_unprepare(clk); gpiochip_error: if (gpiochip_remove(pctl->chip)) dev_err(&pdev->dev, "failed to remove gpio chip\n"); |