pinctrl: at91: Switch to using managed clk_get
authorPramod Gurav <pramod.gurav@smartplayin.com>
Sun, 31 Aug 2014 11:21:52 +0000 (16:51 +0530)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 5 Sep 2014 08:34:03 +0000 (10:34 +0200)
This patch switches to using managed version of clk_get and hence
removes clk_put from failure path.

CC: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
CC: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-at91.c

index 03b748e..22b82ad 100644 (file)
@@ -1735,14 +1735,14 @@ static int at91_gpio_probe(struct platform_device *pdev)
        at91_chip->pioc_virq = irq;
        at91_chip->pioc_idx = alias_idx;
 
-       at91_chip->clock = clk_get(&pdev->dev, NULL);
+       at91_chip->clock = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(at91_chip->clock)) {
                dev_err(&pdev->dev, "failed to get clock, ignoring.\n");
                goto err;
        }
 
        if (clk_prepare(at91_chip->clock))
-               goto clk_prep_err;
+               goto err;
 
        /* enable PIO controller's clock */
        if (clk_enable(at91_chip->clock)) {
@@ -1805,8 +1805,6 @@ static int at91_gpio_probe(struct platform_device *pdev)
 
 clk_err:
        clk_unprepare(at91_chip->clock);
-clk_prep_err:
-       clk_put(at91_chip->clock);
 err:
        dev_err(&pdev->dev, "Failure %i for GPIO %i\n", ret, alias_idx);