lkml.org 
[lkml]   [2019]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 22/26] leds: as3645a: Use generic support for composing LED names
From
Date
Pavel,

On 4/24/19 4:01 PM, Pavel Machek wrote:
> Hi!
>
>> Switch to using generic LED support for composing LED class
>> device name.
>>
>> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
>> Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
>
>> +static int as3645a_led_class_setup(struct as3645a *flash)
>> {
>> struct led_classdev *fled_cdev = &flash->fled.led_cdev;
>> struct led_classdev *iled_cdev = &flash->iled_cdev;
>> + struct led_init_data init_data;
>
> Not initialized.
>
>> struct led_flash_setting *cfg;
>> int rval;
>>
>> - iled_cdev->name = names->indicator;
>> iled_cdev->brightness_set_blocking = as3645a_set_indicator_brightness;
>> iled_cdev->max_brightness =
>> flash->cfg.indicator_max_ua / AS_INDICATOR_INTENSITY_STEP;
>> iled_cdev->flags = LED_CORE_SUSPENDRESUME;
>>
>> - rval = led_classdev_register(&flash->client->dev, iled_cdev);
>> + init_data.fwnode = flash->indicator_node;
>> + init_data.devicename = AS_NAME;
>> + init_data.default_label = "indicator";
>
> And struct has one more field:
>
> + /*
> + * indicates if LED name should always comprise
> devicename section;
> + * only LEDs exposed by drivers of hot-pluggable
> devices should
> + * set it to true
> + */
> + bool devname_mandatory;
> };
>
> I believe it would be cleaner to always initialize struct with zeros;
> that way you can also expand it in future.

Good point. Will fix that in v5.

--
Best regards,
Jacek Anaszewski

\
 
 \ /
  Last update: 2019-04-24 20:19    [W:0.110 / U:1.668 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site