net: dsa: tag_ocelot_8021q: fix driver dependency
authorArnd Bergmann <arnd@arndb.de>
Thu, 25 Feb 2021 14:38:32 +0000 (15:38 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 26 Feb 2021 23:29:53 +0000 (15:29 -0800)
commit01c2c1ad8f45e0c191bfd961dc41cd77df0d7a2f
treed2b6c42b30a04dcb7554b7eb361d2fbf96c6e6b0
parent907310ceb27ee4259bedb6c1257f5d05ee44f3ce
net: dsa: tag_ocelot_8021q: fix driver dependency

When the ocelot driver code is in a library, the dsa tag
code cannot be built-in:

ld.lld: error: undefined symbol: ocelot_can_inject
>>> referenced by tag_ocelot_8021q.c
>>>               dsa/tag_ocelot_8021q.o:(ocelot_xmit) in archive net/built-in.a

ld.lld: error: undefined symbol: ocelot_port_inject_frame
>>> referenced by tag_ocelot_8021q.c
>>>               dsa/tag_ocelot_8021q.o:(ocelot_xmit) in archive net/built-in.a

Building the tag support only really makes sense for compile-testing
when the driver is available, so add a Kconfig dependency that prevents
the broken configuration while allowing COMPILE_TEST alternative when
MSCC_OCELOT_SWITCH_LIB is disabled entirely.  This case is handled
through the #ifdef check in include/soc/mscc/ocelot.h.

Fixes: 0a6f17c6ae21 ("net: dsa: tag_ocelot_8021q: add support for PTP timestamping")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20210225143910.3964364-2-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/dsa/Kconfig