Linux LED subsystem development
 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 v3 1/2] leds: lm3532: Propagate enable GPIO errors
Date: Fri, 13 Nov 2026 11:21:44 +0000	[thread overview]
Message-ID: <179310027340.2808517.7320226573540907171@kernel.org> (raw)
In-Reply-To: <20261021045832.16356-1-phucduc.bui@gmail.com>

On Wed, 21 Oct 2026, phucduc.bui@gmail.com wrote:

> From: bui duc phuc <phucduc.bui@gmail.com>
>
> devm_gpiod_get_optional() returns NULL when the optional GPIO is not
> present, but may return -EPROBE_DEFER or other errors.
>
> lm3532_parse_node() currently treats GPIO lookup errors as if the GPIO
> were not present.
>
> Check the return value and propagate errors from the enable GPIO lookup.
>
> Fixes: bc1b8492c764 ("leds: lm3532: Introduce the lm3532 LED driver")
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
>
> Link v1 : 
> https://lore.kernel.org/all/20261007104915.507801-1-phucduc.bui@gmail.com/
> Link v2 : 
> https://lore.kernel.org/all/20261009091059.25729-1-phucduc.bui@gmail.com/
>
> Changes in v2:
>  - Capitalize the first letter of the commit message subject 
>
>  drivers/leds/leds-lm3532.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/leds/leds-lm3532.c b/drivers/leds/leds-lm3532.c
> index b51496910b08..a3bc9680dc4c 100644
> --- a/drivers/leds/leds-lm3532.c
> +++ b/drivers/leds/leds-lm3532.c
> @@ -560,7 +560,8 @@ static int lm3532_parse_node(struct lm3532_data *priv)
>  	priv->enable_gpio = devm_gpiod_get_optional(&priv->client->dev,
>  						   "enable", GPIOD_OUT_LOW);
>  	if (IS_ERR(priv->enable_gpio))
> -		priv->enable_gpio = NULL;
> +		return dev_err_probe(&priv->client->dev, PTR_ERR(priv->enable_gpio),
> +				     "failed to get enable GPIO\n")

Please capitalise the first letter of the error message.

>  	if (priv->enable_gpio) {
>  		ret = devm_add_action(&priv->client->dev, gpio_set_low_action, priv);
> -- 
> 2.43.0
>
>

-- 
Lee Jones

      parent reply	other threads:[~2026-11-13 11:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21  4:58 [PATCH v3 1/2] leds: lm3532: Propagate enable GPIO errors phucduc.bui
2026-10-21  4:58 ` [PATCH v3 2/2] leds: lm3532: Avoid duplicate error messages phucduc.bui
2026-10-21  5:01   ` sashiko-bot
2026-11-13 11:20   ` Lee Jones
2026-10-21  5:01 ` [PATCH v3 1/2] leds: lm3532: Propagate enable GPIO errors sashiko-bot
2026-10-30 12:59 ` Griffin Kroah-Hartman
2026-11-13 11:21 ` Lee Jones [this message]

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=179310027340.2808517.7320226573540907171@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