mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: fp9931: fail probe if runtime PM setup fails
@ 2026-11-29 13:44 Jiawen Liu
  0 siblings, 0 replies; only message in thread
From: Jiawen Liu @ 2026-11-29 13:44 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: linux-kernel

fp9931_probe() ignored a failure from devm_pm_runtime_enable(). The
helper rolls runtime PM back when action registration fails, but probe
continued into timing and regulator setup that may require a successful
runtime resume.

Propagate the runtime PM setup error before configuring autosuspend or
touching the device.

Fixes: 12d821bd13d4 ("regulator: Add FP9931/JD9930 driver")
Signed-off-by: Jiawen Liu <1298662399@qq.com>
---
 drivers/regulator/fp9931.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/fp9931.c b/drivers/regulator/fp9931.c
index da0f5dd87f2f2..72be6b3b923a4 100644
--- a/drivers/regulator/fp9931.c
+++ b/drivers/regulator/fp9931.c
@@ -456,7 +456,10 @@ static int fp9931_probe(struct i2c_client *client)
 				     "failed to request irq\n");
 
 	if (IS_ENABLED(CONFIG_PM)) {
-		devm_pm_runtime_enable(&client->dev);
+		ret = devm_pm_runtime_enable(&client->dev);
+		if (ret)
+			return dev_err_probe(&client->dev, ret,
+					     "failed to enable runtime PM\n");
 		pm_runtime_set_autosuspend_delay(&client->dev, 4000);
 		pm_runtime_use_autosuspend(&client->dev);
 	} else {
-- 
2.34.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-29 13:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-29 13:44 [PATCH] regulator: fp9931: fail probe if runtime PM setup fails Jiawen Liu

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®