diff mbox series

[v1,1/1] leds: tca6507: Get rid of duplicate of_node assignment

Message ID 20211202210613.78584-1-andriy.shevchenko@linux.intel.com
State Superseded
Headers show
Series [v1,1/1] leds: tca6507: Get rid of duplicate of_node assignment | expand

Commit Message

Andy Shevchenko Dec. 2, 2021, 9:06 p.m. UTC
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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/leds/leds-tca6507.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Pavel Machek Dec. 3, 2021, 7:31 a.m. UTC | #1
Hi!

> 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.

So... where do you see of_gpio_dev_init called in this particular
case?

Best regards,
								Pavel
Andy Shevchenko Dec. 3, 2021, 12:18 p.m. UTC | #2
On Fri, Dec 03, 2021 at 08:31:21AM +0100, Pavel Machek wrote:
> Hi!
> 
> > 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.
> 
> So... where do you see of_gpio_dev_init called 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()
Andy Shevchenko Dec. 10, 2021, 1:23 p.m. UTC | #3
On Fri, Dec 03, 2021 at 02:18:42PM +0200, Andy Shevchenko wrote:
> On Fri, Dec 03, 2021 at 08:31:21AM +0100, Pavel Machek wrote:

...

> > > 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?
> 
> 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?
diff mbox series

Patch

diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c
index de8eed9b667d..1473ced8664c 100644
--- a/drivers/leds/leds-tca6507.c
+++ b/drivers/leds/leds-tca6507.c
@@ -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;