diff mbox series

[3/3] net: dsa: mt7530: add GPIOLIB dependency

Message ID 20210225143910.3964364-3-arnd@kernel.org
State New
Headers show
Series [1/3] net: mscc: ocelot: select NET_DEVLINK | expand

Commit Message

Arnd Bergmann Feb. 25, 2021, 2:38 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de>


The new gpio support may be optional at runtime, but it requires
building against gpiolib:

ERROR: modpost: "gpiochip_get_data" [drivers/net/dsa/mt7530.ko] undefined!
ERROR: modpost: "devm_gpiochip_add_data_with_key" [drivers/net/dsa/mt7530.ko] undefined!

Add a Kconfig dependency to enforce this.

Fixes: 429a0edeefd8 ("net: dsa: mt7530: MT7530 optional GPIO support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/net/dsa/Kconfig | 1 +
 1 file changed, 1 insertion(+)

-- 
2.29.2

Comments

Qingfang Deng Feb. 25, 2021, 3:52 p.m. UTC | #1
Hi Arnd,

On Thu, Feb 25, 2021 at 10:40 PM Arnd Bergmann <arnd@kernel.org> wrote:
>

> From: Arnd Bergmann <arnd@arndb.de>

>

> The new gpio support may be optional at runtime, but it requires

> building against gpiolib:

>

> ERROR: modpost: "gpiochip_get_data" [drivers/net/dsa/mt7530.ko] undefined!

> ERROR: modpost: "devm_gpiochip_add_data_with_key" [drivers/net/dsa/mt7530.ko] undefined!

>

> Add a Kconfig dependency to enforce this.


I think wrapping the GPIO code block with #ifdef CONFIG_GPIOLIB ...
#endif may be a better idea.

>

> Fixes: 429a0edeefd8 ("net: dsa: mt7530: MT7530 optional GPIO support")

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Arnd Bergmann Feb. 25, 2021, 4:14 p.m. UTC | #2
On Thu, Feb 25, 2021 at 4:52 PM DENG Qingfang <dqfext@gmail.com> wrote:
>

> Hi Arnd,

>

> On Thu, Feb 25, 2021 at 10:40 PM Arnd Bergmann <arnd@kernel.org> wrote:

> >

> > From: Arnd Bergmann <arnd@arndb.de>

> >

> > The new gpio support may be optional at runtime, but it requires

> > building against gpiolib:

> >

> > ERROR: modpost: "gpiochip_get_data" [drivers/net/dsa/mt7530.ko] undefined!

> > ERROR: modpost: "devm_gpiochip_add_data_with_key" [drivers/net/dsa/mt7530.ko] undefined!

> >

> > Add a Kconfig dependency to enforce this.

>

> I think wrapping the GPIO code block with #ifdef CONFIG_GPIOLIB ...

> #endif may be a better idea.


In practice there is little difference, as most configurations have GPIOLIB
enabled anyway, in particular every configuration in which this driver is
used.

If you want to send an alternative patch to add the #ifdef, please include

Reported-by: Arnd Bergmann <arnd@arndb.de>

      Arnd
diff mbox series

Patch

diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
index 3af373e90806..07fc2a732597 100644
--- a/drivers/net/dsa/Kconfig
+++ b/drivers/net/dsa/Kconfig
@@ -37,6 +37,7 @@  config NET_DSA_LANTIQ_GSWIP
 config NET_DSA_MT7530
 	tristate "MediaTek MT753x and MT7621 Ethernet switch support"
 	depends on NET_DSA
+	depends on GPIOLIB
 	select NET_DSA_TAG_MTK
 	help
 	  This enables support for the MediaTek MT7530, MT7531, and MT7621