[PATCH v2 2/2] leds: lm3532: Avoid duplicate error messages

From: phucduc . bui

Date: Fri Oct 09 2026 - 05:20:43 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

Most error paths in lm3532_parse_node() already log errors. Add an
error message for the devm_add_action() failure and remove the
redundant error message from lm3532_probe() to avoid duplicate logs.

Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
drivers/leds/leds-lm3532.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/leds/leds-lm3532.c b/drivers/leds/leds-lm3532.c
index a3bc9680dc4c..05856c053fac 100644
--- a/drivers/leds/leds-lm3532.c
+++ b/drivers/leds/leds-lm3532.c
@@ -566,7 +566,8 @@ static int lm3532_parse_node(struct lm3532_data *priv)
if (priv->enable_gpio) {
ret = devm_add_action(&priv->client->dev, gpio_set_low_action, priv);
if (ret)
- return ret;
+ return dev_err_probe(&priv->client->dev, ret,
+ "failed to add GPIO action\n");
}

priv->regulator = devm_regulator_get(&priv->client->dev, "vin");
@@ -708,10 +709,8 @@ static int lm3532_probe(struct i2c_client *client)
i2c_set_clientdata(client, drvdata);

ret = lm3532_parse_node(drvdata);
- if (ret) {
- dev_err(&client->dev, "Failed to parse node\n");
+ if (ret)
return ret;
- }

return ret;
}
--
2.43.0