linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Jean-Jacques Hiblot <jjhiblot@ti.com>, pavel@ucw.cz, dmurphy@ti.com
Cc: tomi.valkeinen@ti.com, linux-leds@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 2/2] leds: tlc591xx: use devm_led_classdev_register_ext()
Date: Fri, 20 Sep 2019 22:29:30 +0200	[thread overview]
Message-ID: <b4387d66-febd-ff20-7b5e-e66e5de8a988@gmail.com> (raw)
In-Reply-To: <20190920115806.14475-3-jjhiblot@ti.com>

Hi Jean,

Thank you for the update.

On 9/20/19 1:58 PM, Jean-Jacques Hiblot wrote:
> Use devm_led_classdev_register_ext() to pass the fwnode to the LED core.
> The fwnode can then be used by the firmware core to create meaningful
> names.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> ---
>  drivers/leds/leds-tlc591xx.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c
> index bbdaa3148317..8eadb673dc2e 100644
> --- a/drivers/leds/leds-tlc591xx.c
> +++ b/drivers/leds/leds-tlc591xx.c
> @@ -186,6 +186,9 @@ tlc591xx_probe(struct i2c_client *client,
>  
>  	for_each_child_of_node(np, child) {
>  		struct tlc591xx_led *led;
> +		struct led_init_data init_data = {};
> +
> +		init_data.fwnode = of_fwnode_handle(child);
>  
>  		err = of_property_read_u32(child, "reg", &reg);
>  		if (err) {
> @@ -200,8 +203,6 @@ tlc591xx_probe(struct i2c_client *client,
>  		led = &priv->leds[reg];
>  
>  		led->active = true;
> -		led->ldev.name =
> -			of_get_property(child, "label", NULL) ? : child->name;
>  		led->ldev.default_trigger =
>  			of_get_property(child, "linux,default-trigger", NULL);
>  
> @@ -209,7 +210,8 @@ tlc591xx_probe(struct i2c_client *client,
>  		led->led_no = reg;
>  		led->ldev.brightness_set_blocking = tlc591xx_brightness_set;
>  		led->ldev.max_brightness = LED_FULL;

I was asking for removing tabove assignment, but we can always do that
in the incremental patch.

Patch set applied to the for-5.5 branch. Thanks.

> -		err = devm_led_classdev_register(dev, &led->ldev);
> +		err = devm_led_classdev_register_ext(dev, &led->ldev,
> +						     &init_data);
>  		if (err < 0) {
>  			dev_err(dev, "couldn't register LED %s\n",
>  				led->ldev.name);
> 

-- 
Best regards,
Jacek Anaszewski

  reply	other threads:[~2019-09-20 20:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20 11:58 [PATCH v4 0/2] leds: tlc591xx: switch to managed LED registration Jean-Jacques Hiblot
2019-09-20 11:58 ` [PATCH v4 1/2] leds: tlc591xx: simplify driver by using the managed led API Jean-Jacques Hiblot
2019-09-20 11:58 ` [PATCH v4 2/2] leds: tlc591xx: use devm_led_classdev_register_ext() Jean-Jacques Hiblot
2019-09-20 20:29   ` Jacek Anaszewski [this message]
2019-09-23 10:01     ` Jean-Jacques Hiblot

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=b4387d66-febd-ff20-7b5e-e66e5de8a988@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=dmurphy@ti.com \
    --cc=jjhiblot@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=tomi.valkeinen@ti.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;
as well as URLs for NNTP newsgroup(s).