mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpio: pca953x: propagate regulator_enable() error from resume
@ 2026-05-20 11:05 Stepan Ionichev
  2026-05-21  8:04 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Stepan Ionichev @ 2026-05-20 11:05 UTC (permalink / raw)
  To: brgl; +Cc: linus.walleij, andy, hcazarim, linux-gpio, linux-kernel, sozdayvek

pca953x_resume() returns 0 when regulator_enable() fails, dropping
the real error code and masking the failure as a successful resume.
The caller then proceeds as if the chip is powered, while the
regulator is in fact disabled.

Return ret so PM core sees the actual failure.

Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com>
---
 drivers/gpio/gpio-pca953x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 52e96cc5f..b9c905a0f 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -1411,7 +1411,7 @@ static int pca953x_resume(struct device *dev)
 		ret = regulator_enable(chip->regulator);
 		if (ret) {
 			dev_err(dev, "Failed to enable regulator: %d\n", ret);
-			return 0;
+			return ret;
 		}
 	}
 
-- 
2.43.0


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

* Re: [PATCH] gpio: pca953x: propagate regulator_enable() error from resume
  2026-05-20 11:05 [PATCH] gpio: pca953x: propagate regulator_enable() error from resume Stepan Ionichev
@ 2026-05-21  8:04 ` Bartosz Golaszewski
  0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2026-05-21  8:04 UTC (permalink / raw)
  To: brgl, Stepan Ionichev
  Cc: Bartosz Golaszewski, andy, hcazarim, linux-gpio, linux-kernel,
	Linus Walleij


On Wed, 20 May 2026 16:05:04 +0500, Stepan Ionichev wrote:
> pca953x_resume() returns 0 when regulator_enable() fails, dropping
> the real error code and masking the failure as a successful resume.
> The caller then proceeds as if the chip is powered, while the
> regulator is in fact disabled.
> 
> Return ret so PM core sees the actual failure.
> 
> [...]

Applied, thanks!

[1/1] gpio: pca953x: propagate regulator_enable() error from resume
      https://git.kernel.org/brgl/c/be460cedb67ab803c1bebceac19b1d44acb85d30

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

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

end of thread, other threads:[~2026-05-21  8:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-20 11:05 [PATCH] gpio: pca953x: propagate regulator_enable() error from resume Stepan Ionichev
2026-05-21  8:04 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®