070-v4.5-0003-net-bgmac-clarify-CONFIG_BCMA-dependency.patch 1.8 KB

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