[PATCH] regulator: qcom-labibb: print the real error when registration fails
From: Cong Nguyen
Date: Sat Nov 28 2026 - 11:40:56 EST
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@xxxxxxxxx>
---
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