]> git.hungrycats.org Git - linux/commitdiff
gpio: zynq: Fix the error path
authorShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Mon, 4 Apr 2016 18:14:06 +0000 (23:44 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Jun 2016 17:22:04 +0000 (10:22 -0700)
commit 615d23f80efc60f8c5146223f305d19207c742e4 upstream.

pm_runtime_disable is called only in remove it is missed
out in the error path.
Fix the same.

Signed-off-by: Shubhrajyoti Datta <shubhraj@xilinx.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Helmut Grohne <h.grohne@intenta.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpio-zynq.c

index 66d3d247d76d8e3f2e05b47ffbf32a05c69ecb67..75c6355b018df46a192feaa4f57dedcb5be6f7b7 100644 (file)
@@ -713,7 +713,7 @@ static int zynq_gpio_probe(struct platform_device *pdev)
        pm_runtime_enable(&pdev->dev);
        ret = pm_runtime_get_sync(&pdev->dev);
        if (ret < 0)
-               return ret;
+               goto err_pm_dis;
 
        /* report a bug if gpio chip registration fails */
        ret = gpiochip_add_data(chip, gpio);
@@ -745,6 +745,8 @@ err_rm_gpiochip:
        gpiochip_remove(chip);
 err_pm_put:
        pm_runtime_put(&pdev->dev);
+err_pm_dis:
+       pm_runtime_disable(&pdev->dev);
 
        return ret;
 }