mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiawen Liu <1298662399@qq.com>
To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] regulator: fp9931: handle no-PM cleanup registration failure
Date: Sun, 29 Nov 2026 17:45:03 +0400	[thread overview]
Message-ID: <tencent_96163941EEE8A6382901B2FEA2549AD41B0A@qq.com> (raw)

Without runtime PM, fp9931_probe() powers the chip up manually and
registers a devres action to power it down again. If registering that
action fails, the reset helper immediately releases the temperature-enable
GPIO and VIN regulator, but the ignored error lets probe continue using
hardware that may now be unpowered.

Propagate the registration failure before timing setup or regulator and
hwmon registration.

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..280aadbec2421 100644
--- a/drivers/regulator/fp9931.c
+++ b/drivers/regulator/fp9931.c
@@ -464,7 +464,10 @@ static int fp9931_probe(struct i2c_client *client)
 		if (ret < 0)
 			return ret;
 
-		devm_add_action_or_reset(&client->dev, disable_nopm, data);
+		ret = devm_add_action_or_reset(&client->dev, disable_nopm,
+					       data);
+		if (ret)
+			return ret;
 	}
 
 	ret = setup_timings(data);
-- 
2.34.1


                 reply	other threads:[~2026-11-29 13:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_96163941EEE8A6382901B2FEA2549AD41B0A@qq.com \
    --to=1298662399@qq.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®