diff mbox series

[net-next] net: dsa: b53: Fix build with B53_SRAB enabled and B53_SERDES=m

Message ID 20180927100244.692546-1-arnd@arndb.de
State Accepted
Commit d2f1e81a40cac3cff2af6136855424186a7fa369
Headers show
Series [net-next] net: dsa: b53: Fix build with B53_SRAB enabled and B53_SERDES=m | expand

Commit Message

Arnd Bergmann Sept. 27, 2018, 10:02 a.m. UTC
When B53_SERDES is a loadable module, a built-in srab driver still
cannot reach it, so the previous fix is incomplete:

b53_srab.c:(.text+0x3f4): undefined reference to `b53_serdes_init'
drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe64): undefined reference to `b53_serdes_link_state'
drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe74): undefined reference to `b53_serdes_link_set'
drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe88): undefined reference to `b53_serdes_an_restart'
drivers/net/dsa/b53/b53_srab.o:(.rodata+0xea0): undefined reference to `b53_serdes_phylink_validate'
drivers/net/dsa/b53/b53_srab.o:(.rodata+0xea4): undefined reference to `b53_serdes_config'

Add a Kconfig dependency that forces srab to also be a module
in this case, but allow it to be built-in when serdes is
disabled or built-in.

Fixes: 7a8c7f5c30f9 ("net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

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

-- 
2.18.0

Comments

Florian Fainelli Sept. 27, 2018, 7:07 p.m. UTC | #1
On 09/27/2018 03:02 AM, Arnd Bergmann wrote:
> When B53_SERDES is a loadable module, a built-in srab driver still

> cannot reach it, so the previous fix is incomplete:

> 

> b53_srab.c:(.text+0x3f4): undefined reference to `b53_serdes_init'

> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe64): undefined reference to `b53_serdes_link_state'

> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe74): undefined reference to `b53_serdes_link_set'

> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe88): undefined reference to `b53_serdes_an_restart'

> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xea0): undefined reference to `b53_serdes_phylink_validate'

> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xea4): undefined reference to `b53_serdes_config'

> 

> Add a Kconfig dependency that forces srab to also be a module

> in this case, but allow it to be built-in when serdes is

> disabled or built-in.

> 

> Fixes: 7a8c7f5c30f9 ("net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES")

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


Acked-by: Florian Fainelli <f.fainelli@gmail.com>


Thanks!
-- 
Florian
David Miller Sept. 28, 2018, 5:33 p.m. UTC | #2
From: Arnd Bergmann <arnd@arndb.de>

Date: Thu, 27 Sep 2018 12:02:38 +0200

> When B53_SERDES is a loadable module, a built-in srab driver still

> cannot reach it, so the previous fix is incomplete:

> 

> b53_srab.c:(.text+0x3f4): undefined reference to `b53_serdes_init'

> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe64): undefined reference to `b53_serdes_link_state'

> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe74): undefined reference to `b53_serdes_link_set'

> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe88): undefined reference to `b53_serdes_an_restart'

> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xea0): undefined reference to `b53_serdes_phylink_validate'

> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xea4): undefined reference to `b53_serdes_config'

> 

> Add a Kconfig dependency that forces srab to also be a module

> in this case, but allow it to be built-in when serdes is

> disabled or built-in.

> 

> Fixes: 7a8c7f5c30f9 ("net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES")

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


Applied, thanks Arnd.
David Miller Sept. 28, 2018, 5:35 p.m. UTC | #3
From: Florian Fainelli <f.fainelli@gmail.com>

Date: Thu, 27 Sep 2018 12:07:01 -0700

> On 09/27/2018 03:02 AM, Arnd Bergmann wrote:

>> When B53_SERDES is a loadable module, a built-in srab driver still

>> cannot reach it, so the previous fix is incomplete:

>> 

>> b53_srab.c:(.text+0x3f4): undefined reference to `b53_serdes_init'

>> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe64): undefined reference to `b53_serdes_link_state'

>> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe74): undefined reference to `b53_serdes_link_set'

>> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xe88): undefined reference to `b53_serdes_an_restart'

>> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xea0): undefined reference to `b53_serdes_phylink_validate'

>> drivers/net/dsa/b53/b53_srab.o:(.rodata+0xea4): undefined reference to `b53_serdes_config'

>> 

>> Add a Kconfig dependency that forces srab to also be a module

>> in this case, but allow it to be built-in when serdes is

>> disabled or built-in.

>> 

>> Fixes: 7a8c7f5c30f9 ("net: dsa: b53: Fix build with B53_SRAB enabled and not B53_SERDES")

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

> 

> Acked-by: Florian Fainelli <f.fainelli@gmail.com>


Applied, thanks Arnd.
diff mbox series

Patch

diff --git a/drivers/net/dsa/b53/Kconfig b/drivers/net/dsa/b53/Kconfig
index e83ebfafd881..d32469283f97 100644
--- a/drivers/net/dsa/b53/Kconfig
+++ b/drivers/net/dsa/b53/Kconfig
@@ -31,6 +31,7 @@  config B53_MMAP_DRIVER
 config B53_SRAB_DRIVER
 	tristate "B53 SRAB connected switch driver"
 	depends on B53 && HAS_IOMEM
+	depends on B53_SERDES || !B53_SERDES
 	default ARCH_BCM_IPROC
 	help
 	  Select to enable support for memory-mapped Switch Register Access