[PATCH 10/10] regulator: rt6190: Check pm_runtime_resume_and_get() return value in rt6190_out_enable()

From: Lee Jones

Date: Wed Nov 04 2026 - 14:01:10 EST


rt6190_out_enable() ignores the return value of pm_runtime_get_sync()
and proceeds with register accesses even if runtime resume fails.

Use pm_runtime_resume_and_get() and return the error code on failure so
the usage counter is not left elevated and registers are not accessed
while the device is suspended.

Fixes: e6999e7cca7e ("regulator: rt6190: Add support for Richtek RT6190 regulator")
Closes: https://sashiko.dev/#/bug/linux-dcfab9b2-550f-4319-87a5-682c3f6cef75
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
drivers/regulator/rt6190-regulator.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/rt6190-regulator.c b/drivers/regulator/rt6190-regulator.c
index 21ced348a2cf..973335a9178d 100644
--- a/drivers/regulator/rt6190-regulator.c
+++ b/drivers/regulator/rt6190-regulator.c
@@ -99,7 +99,9 @@ static int rt6190_out_enable(struct regulator_dev *rdev)
u8 out_cfg[4];
int ret;

- pm_runtime_get_sync(data->dev);
+ ret = pm_runtime_resume_and_get(data->dev);
+ if (ret)
+ return ret;

/*
* From off to on, vout config will restore to IC default.
--
2.56.0.385.gac671c819a-goog