All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Russell King <linux@armlinux.org.uk>
Subject: Re: [PATCH] leds: gpio: Fix uninitialized gpio label for fwnode based probe
Date: Sat, 21 Dec 2019 21:17:54 +0100	[thread overview]
Message-ID: <7ff6e22f-537a-e205-db19-a75d33af8487@gmail.com> (raw)
In-Reply-To: <20191221184957.GD32732@amd>

On 12/21/19 7:49 PM, Pavel Machek wrote:
> Hi!
> 
>> When switching to using generic LED name composition mechanism via
>> devm_led_classdev_register_ext() API the part of code initializing
>> struct gpio_led's template name property was removed alongside.
>> It was however overlooked that the property was also passed to
>> devm_fwnode_get_gpiod_from_child() in place of "label" parameter,
>> which when set to NULL, results in gpio label being initialized to '?'.
>>
>> It could be observed in debugfs and failed to properly identify
>> gpio association with LED consumer.
>>
>> Fix this shortcoming by updating the GPIO label after the LED is
>> registered and its final name is known.
>>
>> Fixes: d7235f5feaa0 ("leds: gpio: Use generic support for composing LED names")
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Cc: Pavel Machek <pavel@ucw.cz>
>> Cc: Russell King <linux@armlinux.org.uk>
>> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> 
> Patch looks good, except:
> 
>> @@ -151,9 +151,14 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev)
>>  		struct gpio_led led = {};
>>  		const char *state = NULL;
>>  
>> +		/**
>> +		 * Acquire gpiod from DT with uninitialized label, which
>> +		 * will be updated after LED class device is registered,
>> +		 * Only then the final LED name is known.
>> +		 */
>>  		led.gpiod = devm_fwnode_get_gpiod_from_child(dev, NULL, child,
>>  							     GPIOD_ASIS,
>> -							     led.name);
>> +							     NULL);
> 
> This is not linuxdoc, so comment should beging with /* AFAICT.

Right.

> I'll probably hand-edit the patch.

Sure, thanks.

-- 
Best regards,
Jacek Anaszewski

      reply	other threads:[~2019-12-21 20:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 21:25 [PATCH] leds: gpio: Fix uninitialized gpio label for fwnode based probe Jacek Anaszewski
2019-12-11  0:44 ` Linus Walleij
2019-12-21 18:49 ` Pavel Machek
2019-12-21 20:17   ` Jacek Anaszewski [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=7ff6e22f-537a-e205-db19-a75d33af8487@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=pavel@ucw.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.