All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cong Nguyen <congnt264@gmail.com>
To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] regulator: qcom-labibb: print the real error when registration fails
Date: Sat, 28 Nov 2026 23:40:47 +0700	[thread overview]
Message-ID: <20261128164047.1831945-1-congnt264@gmail.com> (raw)

When devm_regulator_register() fails, the error message prints ret, but
ret is not set from the registration result. It still holds 0 from the
earlier regmap_read() or devm_request_threaded_irq() call, so the log
says "error registering lab : 0" while probe returns the real error.

Set ret from PTR_ERR() before the message and return it.

Fixes: 498ab2fdf855 ("regulator: qcom: Add labibb driver")
Signed-off-by: Cong Nguyen <congnt264@gmail.com>
---
 drivers/regulator/qcom-labibb-regulator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/qcom-labibb-regulator.c b/drivers/regulator/qcom-labibb-regulator.c
index 8641e69b55c3..e23f29fd6cc7 100644
--- a/drivers/regulator/qcom-labibb-regulator.c
+++ b/drivers/regulator/qcom-labibb-regulator.c
@@ -872,9 +872,10 @@ static int qcom_labibb_regulator_probe(struct platform_device *pdev)
 							&cfg);
 
 		if (IS_ERR(vreg->rdev)) {
+			ret = PTR_ERR(vreg->rdev);
 			dev_err(dev, "qcom_labibb: error registering %s : %d\n",
 					reg_data->name, ret);
-			return PTR_ERR(vreg->rdev);
+			return ret;
 		}
 
 		ret = devm_request_threaded_irq(vreg->dev, vreg->sc_irq, NULL,
-- 
2.25.1


             reply	other threads:[~2026-11-28 16:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28 16:40 Cong Nguyen [this message]
2026-11-30  8:24 ` [PATCH] regulator: qcom-labibb: print the real error when registration fails Konrad Dybcio
2026-11-30 12:46 ` Mark Brown

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=20261128164047.1831945-1-congnt264@gmail.com \
    --to=congnt264@gmail.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.