linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] leds: tca6507: Get rid of duplicate of_node assignment
@ 2021-12-14 14:27 Andy Shevchenko
  2021-12-14 14:27 ` [PATCH v2 2/2] leds: lgm-sso: " Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2021-12-14 14:27 UTC (permalink / raw)
  To: Pavel Machek, Andy Shevchenko, Amireddy Mallikarjuna reddy,
	Yihao Han, linux-leds, linux-kernel

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()

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: added call graph to the commit message (Pavel)
 drivers/leds/leds-tca6507.c | 3 ---
 1 file changed, 3 deletions(-)

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;
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] leds: lgm-sso: Get rid of duplicate of_node assignment
  2021-12-14 14:27 [PATCH v2 1/2] leds: tca6507: Get rid of duplicate of_node assignment Andy Shevchenko
@ 2021-12-14 14:27 ` Andy Shevchenko
  2021-12-15 20:27   ` Pavel Machek
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2021-12-14 14:27 UTC (permalink / raw)
  To: Pavel Machek, Andy Shevchenko, Amireddy Mallikarjuna reddy,
	Yihao Han, linux-leds, linux-kernel

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()

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: new patch
 drivers/leds/blink/leds-lgm-sso.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/leds/blink/leds-lgm-sso.c b/drivers/leds/blink/leds-lgm-sso.c
index fd8b7573285a..6f270c0272fb 100644
--- a/drivers/leds/blink/leds-lgm-sso.c
+++ b/drivers/leds/blink/leds-lgm-sso.c
@@ -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);
 }
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] leds: lgm-sso: Get rid of duplicate of_node assignment
  2021-12-14 14:27 ` [PATCH v2 2/2] leds: lgm-sso: " Andy Shevchenko
@ 2021-12-15 20:27   ` Pavel Machek
  2021-12-16 14:28     ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2021-12-15 20:27 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Amireddy Mallikarjuna reddy, Yihao Han, linux-leds, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

On Tue 2021-12-14 16:27:39, Andy Shevchenko wrote:
> 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
								
-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] leds: lgm-sso: Get rid of duplicate of_node assignment
  2021-12-15 20:27   ` Pavel Machek
@ 2021-12-16 14:28     ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2021-12-16 14:28 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Andy Shevchenko, Amireddy Mallikarjuna reddy, Yihao Han,
	Linux LED Subsystem, Linux Kernel Mailing List

On Thu, Dec 16, 2021 at 12:29 AM Pavel Machek <pavel@ucw.cz> wrote:
> On Tue 2021-12-14 16:27:39, Andy Shevchenko wrote:
> > 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!

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-16 14:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 14:27 [PATCH v2 1/2] leds: tca6507: Get rid of duplicate of_node assignment Andy Shevchenko
2021-12-14 14:27 ` [PATCH v2 2/2] leds: lgm-sso: " Andy Shevchenko
2021-12-15 20:27   ` Pavel Machek
2021-12-16 14:28     ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).