net: dsa: vsc73xx: Remove dependency on CONFIG_OF
Subsystems (3)
PATCH 1/1 net: dsa: vsc73xx: Remove dependency on CONFIG_OF
There is no build time dependency on CONFIG_OF, but we do need to make sure we gate the initialization of the gpio_chip::of_node member with a proper check on CONFIG_OF_GPIO. This enables the driver to build on platforms that do not have CONFIG_OF enabled.
--- drivers/net/dsa/Kconfig | 3 --- drivers/net/dsa/vitesse-vsc73xx-core.c | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/dsa/Kconfig +0 -3
@@ -105,7 +105,6 @@ config NET_DSA_SMSC_LAN9303_MDIO config NET_DSA_VITESSE_VSC73XX tristate - depends on OF depends on NET_DSA select FIXED_PHY select VITESSE_PHY
@@ -116,7 +115,6 @@ config NET_DSA_VITESSE_VSC73XX config NET_DSA_VITESSE_VSC73XX_SPI tristate "Vitesse VSC7385/7388/7395/7398 SPI mode support" - depends on OF depends on NET_DSA depends on SPI select NET_DSA_VITESSE_VSC73XX
@@ -126,7 +124,6 @@ config NET_DSA_VITESSE_VSC73XX_SPI config NET_DSA_VITESSE_VSC73XX_PLATFORM tristate "Vitesse VSC7385/7388/7395/7398 Platform mode support" - depends on OF depends on NET_DSA depends on HAS_IOMEM select NET_DSA_VITESSE_VSC73XX
drivers/net/dsa/vitesse-vsc73xx-core.c +2 -0
@@ -1111,7 +1111,9 @@ 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.17.1
From: Florian Fainelli <[email protected]>
Date: Thu, 2 Jan 2020 15:34:45 -0800
Quoted 6 lines
There is no build time dependency on
CONFIG_OF, but we do need to make sure we gate the initialization of thegpio_chip::of_nodemember with a proper check onCONFIG_OF_GPIO. This enables the driver to build on platforms that do not haveCONFIG_OFenabled.Signed-off-by Florian Fainelli <[email protected]>
Applied, thanks.
Maybe if this becomes common enough we can have a helper like the ones we have for network namespaces, something like of_node_set().
Quoted 6 lines · Florian Fainelli
There is no build time dependency on
CONFIG_OF, but we do need to make sure we gate the initialization of thegpio_chip::of_nodemember with a proper check onCONFIG_OF_GPIO. This enables the driver to build on platforms that do not haveCONFIG_OFenabled.Signed-off-by Florian Fainelli <[email protected]>
It's nice if some non-DT users need to use this driver, like some board file. Thanks!
Yours,
Linus Walleij