Message ID | 20191001180439.8312-5-dmurphy@ti.com |
---|---|
State | New |
Headers | show |
Series | [1/5] leds: Kconfig: Be consistent with the usage of "LED" | expand |
Jacek On 10/1/19 2:39 PM, Jacek Anaszewski wrote: > Hi Dan, > > Thank you for the patch. > > On 10/1/19 8:04 PM, Dan Murphy wrote: >> Convert LED flash class registration to device managed class >> registration API. >> >> Signed-off-by: Dan Murphy <dmurphy@ti.com> >> --- >> drivers/leds/leds-lm3601x.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/drivers/leds/leds-lm3601x.c b/drivers/leds/leds-lm3601x.c >> index b02972f1a341..a68e4f97739c 100644 >> --- a/drivers/leds/leds-lm3601x.c >> +++ b/drivers/leds/leds-lm3601x.c >> @@ -350,8 +350,7 @@ static int lm3601x_register_leds(struct lm3601x_led *led, >> init_data.devicename = led->client->name; >> init_data.default_label = (led->led_mode == LM3601X_LED_TORCH) ? >> "torch" : "infrared"; >> - >> - return led_classdev_flash_register_ext(&led->client->dev, >> + return devm_led_classdev_flash_register_ext(&led->client->dev, >> &led->fled_cdev, &init_data); > You need to remove led_classdev_flash_unregister(&led->fled_cdev) from > lm3601x_remove() to complete this improvement. > Ack.
diff --git a/drivers/leds/leds-lm3601x.c b/drivers/leds/leds-lm3601x.c index b02972f1a341..a68e4f97739c 100644 --- a/drivers/leds/leds-lm3601x.c +++ b/drivers/leds/leds-lm3601x.c @@ -350,8 +350,7 @@ static int lm3601x_register_leds(struct lm3601x_led *led, init_data.devicename = led->client->name; init_data.default_label = (led->led_mode == LM3601X_LED_TORCH) ? "torch" : "infrared"; - - return led_classdev_flash_register_ext(&led->client->dev, + return devm_led_classdev_flash_register_ext(&led->client->dev, &led->fled_cdev, &init_data); }
Convert LED flash class registration to device managed class registration API. Signed-off-by: Dan Murphy <dmurphy@ti.com> --- drivers/leds/leds-lm3601x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.22.0.214.g8dca754b1e