Commit 9216cad7 authored by Shubhrajyoti Datta's avatar Shubhrajyoti Datta Committed by Greg Kroah-Hartman

gpio: zynq: Fix the error path

commit 615d23f8 upstream.

pm_runtime_disable is called only in remove it is missed
out in the error path.
Fix the same.
Signed-off-by: default avatarShubhrajyoti Datta <shubhraj@xilinx.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Cc: Helmut Grohne <h.grohne@intenta.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7225e466
...@@ -713,7 +713,7 @@ static int zynq_gpio_probe(struct platform_device *pdev) ...@@ -713,7 +713,7 @@ static int zynq_gpio_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
ret = pm_runtime_get_sync(&pdev->dev); ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0) if (ret < 0)
return ret; goto err_pm_dis;
/* report a bug if gpio chip registration fails */ /* report a bug if gpio chip registration fails */
ret = gpiochip_add_data(chip, gpio); ret = gpiochip_add_data(chip, gpio);
...@@ -745,6 +745,8 @@ static int zynq_gpio_probe(struct platform_device *pdev) ...@@ -745,6 +745,8 @@ static int zynq_gpio_probe(struct platform_device *pdev)
gpiochip_remove(chip); gpiochip_remove(chip);
err_pm_put: err_pm_put:
pm_runtime_put(&pdev->dev); pm_runtime_put(&pdev->dev);
err_pm_dis:
pm_runtime_disable(&pdev->dev);
return ret; return ret;
} }
......
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