]> git.baikalelectronics.ru Git - kernel.git/commit
octeontx2-nic: fix mixed module build
authorArnd Bergmann <arnd@arndb.de>
Fri, 15 Oct 2021 21:06:01 +0000 (23:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Oct 2021 12:14:00 +0000 (13:14 +0100)
commit0a3bfc93a8175be757e73991a2170bfb2814297a
treed6ffa1a14d1deb791a745c37d1a0002b53a46c4c
parent1a1cab098a2a306f654c6df25acdc965a334a976
octeontx2-nic: fix mixed module build

Building the VF and PF side of this driver differently, with one being
a loadable module and the other one built-in results in a link failure
for the common PTP driver:

ld.lld: error: undefined symbol: __this_module
>>> referenced by otx2_ptp.c
>>>               net/ethernet/marvell/octeontx2/nic/otx2_ptp.o:(otx2_ptp_init) in archive drivers/built-in.a
>>> referenced by otx2_ptp.c
>>>               net/ethernet/marvell/octeontx2/nic/otx2_ptp.o:(otx2_ptp_init) in archive drivers/built-in.a

Move the otx2_ptp.c code into a separate module that gets built for
both configurations, making it built-in if at least one of the other
two is built-in.

Fixes: ad8d98ccc7c5 ("octeontx2-nicvf: Add PTP hardware clock support to NIX VF")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/nic/Makefile
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c