pinctrl: sunxi: check clk_prepare_enable return value
authorBoris BREZILLON <boris.brezillon@free-electrons.com>
Thu, 10 Apr 2014 13:52:40 +0000 (15:52 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 22 Apr 2014 11:38:35 +0000 (13:38 +0200)
Check the clk_prepare_enable return value to avoid false positive probe.

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>
drivers/pinctrl/pinctrl-sunxi.c

index f9fabe9bf47d433b9152cd438e259e568b3b9ff5..2d9ca1cf6daf3db1a9169c064f363278fc9fcec4 100644 (file)
@@ -884,7 +884,9 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
                goto gpiochip_error;
        }
 
-       clk_prepare_enable(clk);
+       ret = clk_prepare_enable(clk);
+       if (ret)
+               goto gpiochip_error;
 
        pctl->irq = irq_of_parse_and_map(node, 0);
        if (!pctl->irq) {