All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: arizona: disable pm_runtime in case of failure
@ 2020-11-23  8:35 Zheng Liang
  2020-11-23 14:42 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Zheng Liang @ 2020-11-23  8:35 UTC (permalink / raw
  To: linus.walleij, bgolaszewski; +Cc: linux-gpio, wangli74, fangwei1, zhengliang6

pm_runtime_enable will increase power disable depth. Thus a
pairing decrement is needed on the error handling path to keep
it balanced.

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gpio: arizona: disable pm_runtime in case of failure
  2020-11-23  8:35 [PATCH] gpio: arizona: disable pm_runtime in case of failure Zheng Liang
@ 2020-11-23 14:42 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2020-11-23 14:42 UTC (permalink / raw
  To: Zheng Liang; +Cc: Linus Walleij, linux-gpio, wangli74, fangwei1

On Mon, Nov 23, 2020 at 8:39 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.
>
> 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
>

This looks like stable material. Can you add a Fixes: tag?

Bartosz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-23 14:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-23  8:35 [PATCH] gpio: arizona: disable pm_runtime in case of failure Zheng Liang
2020-11-23 14:42 ` Bartosz Golaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.