kernel: remove linux 3.18 support
[openwrt/openwrt.git] / target / linux / generic / pending-4.4 / 070-v4.5-0003-net-bgmac-clarify-CONFIG_BCMA-dependency.patch
1 From 1f820f538f7396db7fd40684b9c3620816acc5a3 Mon Sep 17 00:00:00 2001
2 From: Arnd Bergmann <arnd@arndb.de>
3 Date: Fri, 29 Jan 2016 12:39:12 +0100
4 Subject: [PATCH] net: bgmac: clarify CONFIG_BCMA dependency
5
6 The bgmac driver depends on BCMA_HOST_SOC, which is only used
7 when CONFIG_BCMA is enabled. However, it is a bool option and can
8 be set when CONFIG_BCMA=m, and then bgmac can be built-in, leading
9 to an obvious link error:
10
11 drivers/built-in.o: In function `bgmac_init':
12 :(.init.text+0x7f2c): undefined reference to `__bcma_driver_register'
13 drivers/built-in.o: In function `bgmac_exit':
14 :(.exit.text+0x110a): undefined reference to `bcma_driver_unregister'
15
16 To avoid this case, we need to depend on both BCMA and BCMA_SOC,
17 as this patch does. I'm also trying to make the dependency more
18 readable by splitting it into three lines, and adding a COMPILE_TEST
19 alternative so we can test-build it in all configurations that
20 support BCMA.
21
22 The added dependency on FIXED_PHY addresses a related issue where
23 we cannot call fixed_phy_register() when CONFIG_FIXED_PHY=m and
24 CONFIG_BGMAC=y.
25
26 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
27 Signed-off-by: David S. Miller <davem@davemloft.net>
28 ---
29 drivers/net/ethernet/broadcom/Kconfig | 5 ++++-
30 1 file changed, 4 insertions(+), 1 deletion(-)
31
32 --- a/drivers/net/ethernet/broadcom/Kconfig
33 +++ b/drivers/net/ethernet/broadcom/Kconfig
34 @@ -151,8 +151,11 @@ config BNX2X_VXLAN
35
36 config BGMAC
37 tristate "BCMA bus GBit core support"
38 - depends on BCMA_HOST_SOC && HAS_DMA && (BCM47XX || ARCH_BCM_5301X)
39 + depends on BCMA && BCMA_HOST_SOC
40 + depends on HAS_DMA
41 + depends on BCM47XX || ARCH_BCM_5301X || COMPILE_TEST
42 select PHYLIB
43 + select FIXED_PHY
44 ---help---
45 This driver supports GBit MAC and BCM4706 GBit MAC cores on BCMA bus.
46 They can be found on BCM47xx SoCs and provide gigabit ethernet.