Skip to contentSkip to conversation

gpio: pca953x: propagate regulator_enable() error from resume

PATCH Applied Stepan Ionichev 2 participants 2 messages May 20 – May 21 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: pca953x: propagate regulator_enable() error from resume

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.

---
 drivers/gpio/gpio-pca953x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-pca953x.c +1 -1
index 52e96cc5f..b9c905a0f 100644
@@ -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;
 		}
 	}
 
Signature · 1 line
2.43.0
#1 lore raw
Quoted 8 lines · Stepan Ionichev

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,

Signature · 1 line
Bartosz Golaszewski <[email protected]>