net: mvneta: bm: clarify dependencies

MVNETA_BM has a dependency on MVNETA, so we can only select the former
if the latter is enabled. However, the code dependency is the reverse:
The mvneta module can call into the mvneta_bm module, so mvneta cannot
be a built-in if mvneta_bm is a module, or we get a link error:

drivers/net/built-in.o: In function `mvneta_remove':
drivers/net/ethernet/marvell/mvneta.c:4211: undefined reference to `mvneta_bm_pool_destroy'
drivers/net/built-in.o: In function `mvneta_bm_update_mtu':
drivers/net/ethernet/marvell/mvneta.c:1034: undefined reference to `mvneta_bm_bufs_free'

This avoids the problem by further clarifying the dependency so that
MVNETA_BM is a silent Kconfig option that gets turned on by the
new MVNETA_BM_ENABLE option. This way both the core HWBM module and
the MVNETA_BM code are always built-in when needed.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: dc35a10f68 ("net: mvneta: bm: add support for hardware buffer management")
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Arnd Bergmann 2016-03-15 22:47:14 +01:00 committed by David S. Miller
parent 3a461da1d0
commit 019ded3aa7

View file

@ -40,10 +40,9 @@ config MVMDIO
This driver is used by the MV643XX_ETH and MVNETA drivers. This driver is used by the MV643XX_ETH and MVNETA drivers.
config MVNETA_BM config MVNETA_BM_ENABLE
tristate "Marvell Armada 38x/XP network interface BM support" tristate "Marvell Armada 38x/XP network interface BM support"
depends on MVNETA depends on MVNETA
select HWBM
---help--- ---help---
This driver supports auxiliary block of the network This driver supports auxiliary block of the network
interface units in the Marvell ARMADA XP and ARMADA 38x SoC interface units in the Marvell ARMADA XP and ARMADA 38x SoC
@ -67,6 +66,15 @@ config MVNETA
driver, which should be used for the older Marvell SoCs driver, which should be used for the older Marvell SoCs
(Dove, Orion, Discovery, Kirkwood). (Dove, Orion, Discovery, Kirkwood).
config MVNETA_BM
tristate
default y if MVNETA=y && MVNETA_BM_ENABLE
default MVNETA_BM_ENABLE
select HWBM
help
MVNETA_BM must not be 'm' if MVNETA=y, so this symbol ensures
that all dependencies are met.
config MVPP2 config MVPP2
tristate "Marvell Armada 375 network interface support" tristate "Marvell Armada 375 network interface support"
depends on MACH_ARMADA_375 depends on MACH_ARMADA_375