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

From: Lee Jones

Date: Tue Oct 20 2026 - 06:47:38 EST


--- checkpatch.pl: clean (0 issues) ---

On Fri, 09 Oct 2026, phucduc.bui@xxxxxxxxx wrote:

> 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>

Please capitalise your name appropriately here and in the 'From:' line.

> ---
> 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");

We do not usually print messages for '-ENOMEM' failures.

It was better before.

> }
>
> 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;

return lm3532_parse_node(drvdata);

--
Lee Jones