]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: pca953x: propagate regulator_enable() error from resume
authorStepan Ionichev <sozdayvek@gmail.com>
Wed, 20 May 2026 11:05:04 +0000 (16:05 +0500)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Thu, 21 May 2026 08:04:00 +0000 (10:04 +0200)
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>
Link: https://patch.msgid.link/20260520110504.13969-1-sozdayvek@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpio-pca953x.c

index 52e96cc5f67bb6ef33f8880abb2917b4d7250713..b9c905a0ffa90a2dc4108d45b8fd4c767a04dd5f 100644 (file)
@@ -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;
                }
        }