diff mbox series

[v2] gpio: arizona: disable pm_runtime in case of failure

Message ID 20201124030606.40588-1-zhengliang6@huawei.com
State New
Headers show
Series [v2] gpio: arizona: disable pm_runtime in case of failure | expand

Commit Message

Zheng Liang Nov. 24, 2020, 3:06 a.m. UTC
pm_runtime_enable will increase power disable depth. Thus a
pairing decrement is needed on the error handling path to keep
it balanced.

Fixes:27a49ed17e224(gpio: arizona: Add support for GPIOs that)
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zheng Liang <zhengliang6@huawei.com>
---
 drivers/gpio/gpio-arizona.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Bartosz Golaszewski Nov. 30, 2020, 3:28 p.m. UTC | #1
On Tue, Nov 24, 2020 at 3:08 AM Zheng Liang <zhengliang6@huawei.com> wrote:
>
> pm_runtime_enable will increase power disable depth. Thus a
> pairing decrement is needed on the error handling path to keep
> it balanced.
>
> Fixes:27a49ed17e224(gpio: arizona: Add support for GPIOs that)
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zheng Liang <zhengliang6@huawei.com>
> ---
>  drivers/gpio/gpio-arizona.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c
> index 5bda38e0780f..2bc173c352ce 100644
> --- a/drivers/gpio/gpio-arizona.c
> +++ b/drivers/gpio/gpio-arizona.c
> @@ -192,6 +192,7 @@ static int arizona_gpio_probe(struct platform_device *pdev)
>         ret = devm_gpiochip_add_data(&pdev->dev, &arizona_gpio->gpio_chip,
>                                      arizona_gpio);
>         if (ret < 0) {
> +               pm_runtime_disable(&pdev->dev);
>                 dev_err(&pdev->dev, "Could not register gpiochip, %d\n",
>                         ret);
>                 return ret;
> --
> 2.17.1
>

Applied, thanks!

Bartosz
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c
index 5bda38e0780f..2bc173c352ce 100644
--- a/drivers/gpio/gpio-arizona.c
+++ b/drivers/gpio/gpio-arizona.c
@@ -192,6 +192,7 @@  static int arizona_gpio_probe(struct platform_device *pdev)
 	ret = devm_gpiochip_add_data(&pdev->dev, &arizona_gpio->gpio_chip,
 				     arizona_gpio);
 	if (ret < 0) {
+		pm_runtime_disable(&pdev->dev);
 		dev_err(&pdev->dev, "Could not register gpiochip, %d\n",
 			ret);
 		return ret;