Skip to contentSkip to conversation

leds: tca6507: Get rid of duplicate of_node assignment

PATCH Applied Andy Shevchenko 3 participants 4 messages Dec 14, 2021 – Dec 16, 2021 LED

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 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.

Call graph:
--> tca6507_probe_gpios()

     --> gpiochip_add_data()
       --> gpiochip_add_data_with_key()
         --> of_gpio_dev_init()

---
v2: added call graph to the commit message (Pavel)

 drivers/leds/leds-tca6507.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/leds/leds-tca6507.c +0 -3
index de8eed9b667d..1473ced8664c 100644
@@ -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
#1 lore raw

PATCH v2 2/2 leds: lgm-sso: 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.

Call graph:
--> sso_gpio_gc_init()

     --> devm_gpiochip_add_data
       --> devm_gpiochip_add_data_with_key
         --> gpiochip_add_data_with_key()
           --> of_gpio_dev_init()

---
v2: new patch

 drivers/leds/blink/leds-lgm-sso.c | 1 -
 1 file changed, 1 deletion(-)
drivers/leds/blink/leds-lgm-sso.c +0 -1
index fd8b7573285a..6f270c0272fb 100644
@@ -477,7 +477,6 @@ static int sso_gpio_gc_init(struct device *dev, struct sso_led_priv *priv)
 	gc->ngpio               = priv->gpio.pins;
 	gc->parent              = dev;
 	gc->owner               = THIS_MODULE;
-	gc->of_node             = dev->of_node;
 
 	return devm_gpiochip_add_data(dev, gc, priv);
 }
Signature · 1 line
2.33.0
Applied
#2 lore raw

Re: [PATCH v2 2/2] leds: lgm-sso: Get rid of duplicate of_node assignment

Quoted 5 lines · Andy Shevchenko

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.

Thank you, applied the series.
Pavel

Signature · 1 line
http://www.livejournal.com/~pavelmachek
#3 lore raw

Re: [PATCH v2 2/2] leds: lgm-sso: Get rid of duplicate of_node assignment

Quoted 9 lines · Pavel Machek
Quoted 5 lines · Andy Shevchenko

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.

Thank you, applied the series.

Thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko