linux/drivers/net/ethernet/mellanox/mlxsw
Arnd Bergmann 3d1cbe839a net: mellanox: add DEVLINK dependencies
The new NET_DEVLINK infrastructure can be a loadable module, but the drivers
using it might be built-in, which causes link errors like:

drivers/net/built-in.o: In function `mlx4_load_one':
:(.text+0x2fbfda): undefined reference to `devlink_port_register'
:(.text+0x2fc084): undefined reference to `devlink_port_unregister'
drivers/net/built-in.o: In function `mlxsw_sx_port_remove':
:(.text+0x33a03a): undefined reference to `devlink_port_type_clear'
:(.text+0x33a04e): undefined reference to `devlink_port_unregister'

There are multiple ways to avoid this:

a) add 'depends on NET_DEVLINK || !NET_DEVLINK' dependencies
   for each user
b) use 'select NET_DEVLINK' from each driver that uses it
   and hide the symbol in Kconfig.
c) make NET_DEVLINK a 'bool' option so we don't have to
   list it as a dependency, and rely on the APIs to be
   stubbed out when it is disabled
d) use IS_REACHABLE() rather than IS_ENABLED() to check for
   NET_DEVLINK in include/net/devlink.h

This implements a variation of approach a) by adding an
intermediate symbol that drivers can depend on, and changes
the three drivers using it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 09d4d087cd ("mlx4: Implement devlink interface")
Fixes: c4745500e9 ("mlxsw: Implement devlink interface")
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-03 17:08:59 -05:00
..
cmd.h mlxsw: cmd: Introduce FID-offset flooding tables 2015-10-16 07:15:10 -07:00
core_hwmon.c mlxsw: core: remove an unnecessary condition 2016-01-06 15:07:47 -05:00
core.c mlxsw: core: Add devlink port splitter callbacks 2016-03-01 16:07:30 -05:00
core.h mlxsw: core: Add devlink port splitter callbacks 2016-03-01 16:07:30 -05:00
emad.h mlxsw: Add interface to access registers and process events 2015-07-30 00:05:00 -07:00
item.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-10-20 06:08:27 -07:00
Kconfig net: mellanox: add DEVLINK dependencies 2016-03-03 17:08:59 -05:00
Makefile mlxsw: core: Implement temperature hwmon interface 2015-11-30 15:05:40 -05:00
pci.c mlxsw: pci: Adjust value of CPU egress traffic class 2016-01-06 00:48:50 -05:00
pci.h mlxsw: pci: Implement LAG processing for received packets 2015-12-03 11:49:28 -05:00
port.h mlxsw: spectrum: Introduce port splitting 2016-03-01 16:07:31 -05:00
reg.h mlxsw: reg: Add the Switch Port Acceptable Frame Types register 2016-02-18 10:44:26 -05:00
spectrum_buffers.c mlxsw: spectrum: Add initial support for Spectrum ASIC 2015-10-16 07:15:23 -07:00
spectrum_switchdev.c mlxsw: spectrum: Allow for PVID deletion 2016-02-18 10:44:26 -05:00
spectrum.c mlxsw: spectrum: Introduce port splitting 2016-03-01 16:07:31 -05:00
spectrum.h mlxsw: spectrum: Introduce port splitting 2016-03-01 16:07:31 -05:00
switchx2.c mlxsw: Implement devlink interface 2016-03-01 16:07:30 -05:00
trap.h
txheader.h mlxsw: spectrum: Add initial support for Spectrum ASIC 2015-10-16 07:15:23 -07:00