2019-07-01 16:04:51

by Jean-Jacques Hiblot

[permalink] [raw]
Subject: [PATCH 2/2] leds: tlc591xx: Use the OF version of the LED registration function

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 <[email protected]>
---
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 14e47ff44df5..6a2936c94b73 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 = idx++;
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);
if (err < 0) {
dev_err(dev, "couldn't register LED %s\n",
led->ldev.name);
--
2.17.1


2019-07-01 16:27:18

by Dan Murphy

[permalink] [raw]
Subject: Re: [PATCH 2/2] leds: tlc591xx: Use the OF version of the LED registration function

JJ

On 7/1/19 10:26 AM, 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 <[email protected]>
> ---
> 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 14e47ff44df5..6a2936c94b73 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 = idx++;
> 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);
> if (err < 0) {
> dev_err(dev, "couldn't register LED %s\n",
> led->ldev.name);


Reviewed-by: Dan Murphy <[email protected]>

2019-07-05 20:26:29

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH 2/2] leds: tlc591xx: Use the OF version of the LED registration function

On Mon 2019-07-01 17:26:02, 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 <[email protected]>

Acked-by: Pavel Machek <[email protected]>

> @@ -207,7 +207,7 @@ tlc591xx_probe(struct i2c_client *client,
> led->led_no = idx++;
> 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);
> if (err < 0) {
> dev_err(dev, "couldn't register LED %s\n",
> led->ldev.name);

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


Attachments:
(No filename) (934.00 B)
signature.asc (188.00 B)
Digital signature
Download all attachments