Skip to content

Commit

Permalink
net: dsa: vsc73xx: Remove dependency on CONFIG_OF
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Jan 5, 2020
1 parent 704a0af commit aa1d54c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/net/dsa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/dsa/vitesse-vsc73xx-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aa1d54c

Please sign in to comment.