Skip to contentSkip to conversation

net: dsa: vsc73xxx: Get rid of duplicate of_node assignment

PATCH Applied Andy Shevchenko 3 participants 4 messages Dec 2, 2021 – Dec 3, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: vsc73xxx: 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/net/dsa/vitesse-vsc73xx-core.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/dsa/vitesse-vsc73xx-core.c +0 -3
index 4c18f619ec02..ae55167ce0a6 100644
@@ -1122,9 +1122,6 @@ static int vsc73xx_gpio_probe(struct vsc73xx *vsc)
 	vsc->gc.ngpio = 4;
 	vsc->gc.owner = THIS_MODULE;
 	vsc->gc.parent = vsc->dev;
-#if IS_ENABLED(CONFIG_OF_GPIO)
-	vsc->gc.of_node = vsc->dev->of_node;
-#endif
 	vsc->gc.base = -1;
 	vsc->gc.get = vsc73xx_gpio_get;
 	vsc->gc.set = vsc73xx_gpio_set;
Signature · 1 line
2.33.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 28 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.

---
 drivers/net/dsa/vitesse-vsc73xx-core.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/dsa/vitesse-vsc73xx-core.c +0 -3
index 4c18f619ec02..ae55167ce0a6 100644
@@ -1122,9 +1122,6 @@ static int vsc73xx_gpio_probe(struct vsc73xx *vsc)
 	vsc->gc.ngpio = 4;
 	vsc->gc.owner = THIS_MODULE;
 	vsc->gc.parent = vsc->dev;
-#if IS_ENABLED(CONFIG_OF_GPIO)
-	vsc->gc.of_node = vsc->dev->of_node;
-#endif
 	vsc->gc.base = -1;
 	vsc->gc.get = vsc73xx_gpio_get;
 	vsc->gc.set = vsc73xx_gpio_set;
Signature · 1 line
2.33.0

I'm in To: and everyone else is in Cc? I don't even have the hardware. Adding Linus just in case, although the change seems correct.

#2 lore raw
Quoted 1 line · Vladimir Oltean

On Thu, Dec 02, 2021 at 11:00:29PM +0200, Andy Shevchenko wrote:

...

Quoted 1 line

I'm in To: and everyone else is in Cc? I don't even have the hardware.

get_maintainer + Git heuristics. I see that you have 2 changes out of 9, maybe this what makes it triggered.

Quoted 3 lines

Adding Linus just in case, although the change seems correct.

Thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
In reply to Andy Shevchenko
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Quoted 9 lines · On Thu, 2 Dec 2021 23:00:29 +0200 you 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.

[...]

Here is the summary with links:
- [v1,1/1] net: dsa: vsc73xxx: Get rid of duplicate of_node assignment

    https://git.kernel.org/netdev/net-next/c/ab11393fd004

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html