lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1b0dd104-3deb-ea42-ab59-522f21d8dffe@ti.com>
Date:   Mon, 23 Sep 2019 12:01:07 +0200
From:   Jean-Jacques Hiblot <jjhiblot@...com>
To:     Jacek Anaszewski <jacek.anaszewski@...il.com>, <pavel@....cz>,
        <dmurphy@...com>
CC:     <tomi.valkeinen@...com>, <linux-leds@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 2/2] leds: tlc591xx: use
 devm_led_classdev_register_ext()


On 20/09/2019 22:29, Jacek Anaszewski wrote:
> 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@...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.

right. I forgot to remove this one.

Looking into it, it looks like the TLC actually has 257 levels (OFF, 
PWM: 0% to 99.6%, and full ON)

I'll send a patch for this after testing.

JJ


>
> 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);
>>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ