Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: cavium: Fix build errors due to 'imply CAVIUM_PTP'

If CAVIUM_PTP is m and THUNDER_NIC_VF is y, build fails:

drivers/net/ethernet/cavium/thunder/nicvf_main.o: In function 'nicvf_remove':
nicvf_main.c:(.text+0x1f0): undefined reference to 'cavium_ptp_put'
drivers/net/ethernet/cavium/thunder/nicvf_main.o: In function `nicvf_probe':
nicvf_main.c:(.text+0x557c): undefined reference to 'cavium_ptp_get'

THUNDER_NIC_VF imply CAVIUM_PTP, which allow the config now,
Use IS_REACHABLE() to avoid the vmlinux link error for this case.

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: def2fbffe62c ("kconfig: allow symbols implied by y to become m")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

YueHaibing and committed by
David S. Miller
a7d40cbb 2822d1a6

+1 -1
+1 -1
drivers/net/ethernet/cavium/common/cavium_ptp.h
··· 24 24 struct ptp_clock *ptp_clock; 25 25 }; 26 26 27 - #if IS_ENABLED(CONFIG_CAVIUM_PTP) 27 + #if IS_REACHABLE(CONFIG_CAVIUM_PTP) 28 28 29 29 struct cavium_ptp *cavium_ptp_get(void); 30 30 void cavium_ptp_put(struct cavium_ptp *ptp);