mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: phucduc.bui@gmail.com
Cc: Pavel Machek <pavel@kernel.org>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	Dan Murphy <dmurphy@ti.com>
Subject: Re: [PATCH v2 2/2] leds: lm3532: Avoid duplicate error messages
Date: Tue, 20 Oct 2026 11:32:48 +0100	[thread overview]
Message-ID: <179198414722.839288.1086260869798370727@kernel.org> (raw)
In-Reply-To: <20261009091059.25729-2-phucduc.bui@gmail.com>

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

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

> From: bui duc phuc <phucduc.bui@gmail.com>
>
> 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@gmail.com>

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

  reply	other threads:[~2026-10-20 10:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09  9:10 [PATCH v2 1/2] leds: lm3532: Propagate enable GPIO errors phucduc.bui
2026-10-09  9:10 ` [PATCH v2 2/2] leds: lm3532: Avoid duplicate error messages phucduc.bui
2026-10-20 10:32   ` Lee Jones [this message]
2026-10-13  8:24 ` [PATCH v2 1/2] leds: lm3532: Propagate enable GPIO errors Lee Jones
2026-10-13  8:49   ` Bui Duc Phuc

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=179198414722.839288.1086260869798370727@kernel.org \
    --to=lee@kernel.org \
    --cc=dmurphy@ti.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@kernel.org \
    --cc=phucduc.bui@gmail.com \
    /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®