linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Jacques Hiblot <jjhiblot@ti.com>
To: Jacek Anaszewski <jacek.anaszewski@gmail.com>, <pavel@ucw.cz>,
	<dmurphy@ti.com>
Cc: <tomi.valkeinen@ti.com>, <linux-leds@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [RESEND,v2 2/2] leds: tlc591xx: Use the OF version of the LED registration function
Date: Wed, 11 Sep 2019 10:20:31 +0200	[thread overview]
Message-ID: <75d93001-9403-4ac4-948f-889b9ca4fa1b@ti.com> (raw)
In-Reply-To: <69b5adc1-08fd-a0bd-b5b7-3943d8027253@gmail.com>


On 10/09/2019 22:08, Jacek Anaszewski wrote:
> Hi Jean,
>
> Thank you the patch.
>
> On 9/10/19 3:38 PM, Jean-Jacques Hiblot wrote:
>> The driver parses the device-tree to identify which LED should be handled.
>> Since the information about the device node is known at this time, we can
>> provide the LED core with it. It may be useful later.
>>
>> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
>> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> Acked-by: Pavel Machek <pavel@ucw.cz>
>> ---
>>   drivers/leds/leds-tlc591xx.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c
>> index 3d5a4b92f016..10764a62cb71 100644
>> --- a/drivers/leds/leds-tlc591xx.c
>> +++ b/drivers/leds/leds-tlc591xx.c
>> @@ -207,7 +207,7 @@ tlc591xx_probe(struct i2c_client *client,
>>   		led->led_no = reg;
>>   		led->ldev.brightness_set_blocking = tlc591xx_brightness_set;
>>   		led->ldev.max_brightness = LED_FULL;
>> -		err = devm_led_classdev_register(dev, &led->ldev);
>> +		err = devm_of_led_classdev_register(dev, child, &led->ldev);
> devm_of_led_classdev_register() has been replaced with
> devm_led_classdev_register_ext() recently. Do you have some specific
> reason for passing OF node to the LED registration function?

Not anymore at this point.

I used the OF because the other patchset I posted (leds: Add control of 
the voltage/current regulator to the LED core) uses the of_node to find 
a regulator in the node of the LED. Since the regulator stuff is going 
to need some rework, we can drop this patch.

Thanks

JJ

> Currently this is beneficial only for generic LED name composition
> mechanism basing on 'function' and 'color' DT properties so if you
> want you can convert the driver to that. Please compare such recent
> conversions in linux-leds.git for-next branch [0][1].
>
>>   		if (err < 0) {
>>   			dev_err(dev, "couldn't register LED %s\n",
>>   				led->ldev.name);
>>
> [0]
> https://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git/commit/?h=for-next&id=a50ff28348934913c46feb7945571329e46c70b3
> [1]
> https://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git/commit/?h=for-next&id=4dcbc8f8c59f4b618d651f5ba884ee5bf562c8de
>

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10 13:38 [RESEND,v2 0/2] leds: tlc591xx: switch to OF and managed API Jean-Jacques Hiblot
2019-09-10 13:38 ` [RESEND,v2 1/2] leds: tlc591xx: simplify driver by using the managed led API Jean-Jacques Hiblot
2019-09-10 13:38 ` [RESEND,v2 2/2] leds: tlc591xx: Use the OF version of the LED registration function Jean-Jacques Hiblot
2019-09-10 20:08   ` Jacek Anaszewski
2019-09-11  8:20     ` Jean-Jacques Hiblot [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=75d93001-9403-4ac4-948f-889b9ca4fa1b@ti.com \
    --to=jjhiblot@ti.com \
    --cc=dmurphy@ti.com \
    --cc=jacek.anaszewski@gmail.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).