linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: dsa: vsc73xx: Remove dependency on CONFIG_OF
@ 2020-01-02 23:34 Florian Fainelli
  2020-01-05 22:24 ` David Miller
  2020-01-06  1:45 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Fainelli @ 2020-01-02 23:34 UTC (permalink / raw)
  To: netdev
  Cc: paweldembicki, linus.walleij, Florian Fainelli, Andrew Lunn,
	Vivien Didelot, David S. Miller, open list

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>
---
 drivers/net/dsa/Kconfig                | 3 ---
 drivers/net/dsa/vitesse-vsc73xx-core.c | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
index cbd74a72d0a1..2d38dbc9dd8c 100644
--- a/drivers/net/dsa/Kconfig
+++ b/drivers/net/dsa/Kconfig
@@ -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
diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c
index 42c1574d45f2..69fc0110ce04 100644
--- a/drivers/net/dsa/vitesse-vsc73xx-core.c
+++ b/drivers/net/dsa/vitesse-vsc73xx-core.c
@@ -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;
-- 
2.17.1


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

* Re: [PATCH net-next] net: dsa: vsc73xx: Remove dependency on CONFIG_OF
  2020-01-02 23:34 [PATCH net-next] net: dsa: vsc73xx: Remove dependency on CONFIG_OF Florian Fainelli
@ 2020-01-05 22:24 ` David Miller
  2020-01-06  1:45 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2020-01-05 22:24 UTC (permalink / raw)
  To: f.fainelli
  Cc: netdev, paweldembicki, linus.walleij, andrew, vivien.didelot,
	linux-kernel

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Thu,  2 Jan 2020 15:34:45 -0800

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

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

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

* Re: [PATCH net-next] net: dsa: vsc73xx: Remove dependency on CONFIG_OF
  2020-01-02 23:34 [PATCH net-next] net: dsa: vsc73xx: Remove dependency on CONFIG_OF Florian Fainelli
  2020-01-05 22:24 ` David Miller
@ 2020-01-06  1:45 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2020-01-06  1:45 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, Paweł Dembicki, Andrew Lunn, Vivien Didelot,
	David S. Miller, open list

On Fri, Jan 3, 2020 at 12:34 AM Florian Fainelli <f.fainelli@gmail.com> wrote:

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

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

It's nice if some non-DT users need to use this driver, like
some board file. Thanks!

Yours,
Linus Walleij

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

end of thread, other threads:[~2020-01-06  1:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-02 23:34 [PATCH net-next] net: dsa: vsc73xx: Remove dependency on CONFIG_OF Florian Fainelli
2020-01-05 22:24 ` David Miller
2020-01-06  1:45 ` Linus Walleij

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