]> git.baikalelectronics.ru Git - kernel.git/commit
leds: lm3697: use struct led_init_data when registering
authorMarek Behún <marek.behun@nic.cz>
Thu, 17 Sep 2020 22:33:02 +0000 (00:33 +0200)
committerPavel Machek <pavel@ucw.cz>
Sat, 26 Sep 2020 19:56:40 +0000 (21:56 +0200)
commita954c307b2438f7f499ca2530a0a4818214e45b8
tree08d251e6a7dbd97bd900d03bf7b6ed41aad77039
parentb9e427932e7621a500725096895ec2b96ee8a480
leds: lm3697: use struct led_init_data when registering

By using struct led_init_data when registering we do not need to parse
`label` DT property. Moreover `label` is deprecated and if it is not
present but `color` and `function` are, LED core will compose a name
from these properties instead.

Previously if the `label` DT property was not present, the code composed
name for the LED in the form
  "parent_name::"
For backwards compatibility we therefore set
  init_data->default_label = ":";
so that the LED will not get a different name if `label` property is not
present.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Cc: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
drivers/leds/leds-lm3697.c