leds: tca6507: Get rid of duplicate of_node assignment
PATCH 1/1 leds: tca6507: Get rid of duplicate of_node assignment
GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove assignment here.
For the details one may look into the of_gpio_dev_init() implementation.
--- drivers/leds/leds-tca6507.c | 3 --- 1 file changed, 3 deletions(-)
drivers/leds/leds-tca6507.c +0 -3
@@ -641,9 +641,6 @@ static int tca6507_probe_gpios(struct device *dev, tca->gpio.direction_output = tca6507_gpio_direction_output; tca->gpio.set = tca6507_gpio_set_value; tca->gpio.parent = dev; -#ifdef CONFIG_OF_GPIO - tca->gpio.of_node =of_node_get (dev_of_node (dev)); -#endif err =gpiochip_add_data (&tca->gpio, tca);if (err) { tca->gpio.ngpio =0 ;
Signature · 1 line
2.33.0
Hi!
Quoted 6 lines
GPIO library does copy the
of_nodefrom the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove assignment here.For the details one may look into the
of_gpio_dev_init()implementation.
So... where do you see of_gpio_dev_init called in this particular case?
Best regards,
Pavel
Signature · 1 line
http://www.livejournal.com/~pavelmachek
Quoted 11 lines · Pavel Machek
Hi!
Quoted 6 lines
GPIO library does copy the
of_nodefrom the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove assignment here.For the details one may look into the
of_gpio_dev_init()implementation.So... where do you see
of_gpio_dev_initcalled in this particular case?
Inside GPIO library as stated in the commit message.
--> tca6507_probe_gpios()
--> gpiochip_add_data()
--> gpiochip_add_data_with_key()
--> of_gpio_dev_init()Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 1 line · Andy Shevchenko
On Fri, Dec 03, 2021 at 08:31:21AM +0100, Pavel Machek wrote:
...
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines
For the details one may look into the
of_gpio_dev_init()implementation.So... where do you see
of_gpio_dev_initcalled in this particular case?
Quoted 6 lines
Inside GPIO library as stated in the commit message.
-->
tca6507_probe_gpios()--> gpiochip_add_data() --> gpiochip_add_data_with_key() --> of_gpio_dev_init()
Pavel, do you have any other concerns? Can this be applied?
Signature · 2 lines
With Best Regards, Andy Shevchenko