Skip to content

Commit be9ca0d

Browse files
arndbdavem330
authored andcommitted
cpsw/netcp: work around reverse cpts dependency
The dependency is reversed: cpsw and netcp call into cpts, but cpts depends on the other two in Kconfig. This can lead to cpts being a loadable module and its callers built-in: drivers/net/ethernet/ti/cpsw.o: In function `cpsw_remove': cpsw.c:(.text.cpsw_remove+0xd0): undefined reference to `cpts_release' drivers/net/ethernet/ti/cpsw.o: In function `cpsw_rx_handler': cpsw.c:(.text.cpsw_rx_handler+0x2dc): undefined reference to `cpts_rx_timestamp' drivers/net/ethernet/ti/cpsw.o: In function `cpsw_tx_handler': cpsw.c:(.text.cpsw_tx_handler+0x7c): undefined reference to `cpts_tx_timestamp' drivers/net/ethernet/ti/cpsw.o: In function `cpsw_ndo_stop': As a workaround, I'm introducing another Kconfig symbol to control the compilation of cpts, while making the actual module controlled by a silent symbol that is =y when necessary. Fixes: 6246168 ("net: ethernet: ti: netcp: add support of cpts") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Grygorii Strashko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8fb106b commit be9ca0d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

drivers/net/ethernet/ti/Kconfig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ config TI_CPSW
7474
will be called cpsw.
7575

7676
config TI_CPTS
77-
tristate "TI Common Platform Time Sync (CPTS) Support"
77+
bool "TI Common Platform Time Sync (CPTS) Support"
7878
depends on TI_CPSW || TI_KEYSTONE_NETCP
7979
imply PTP_1588_CLOCK
8080
---help---
@@ -83,6 +83,12 @@ config TI_CPTS
8383
The unit can time stamp PTP UDP/IPv4 and Layer 2 packets, and the
8484
driver offers a PTP Hardware Clock.
8585

86+
config TI_CPTS_MOD
87+
tristate
88+
depends on TI_CPTS
89+
default y if TI_CPSW=y || TI_KEYSTONE_NETCP=y
90+
default m
91+
8692
config TI_KEYSTONE_NETCP
8793
tristate "TI Keystone NETCP Core Support"
8894
select TI_CPSW_ALE

drivers/net/ethernet/ti/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ obj-$(CONFIG_TI_DAVINCI_MDIO) += davinci_mdio.o
1212
obj-$(CONFIG_TI_DAVINCI_CPDMA) += davinci_cpdma.o
1313
obj-$(CONFIG_TI_CPSW_PHY_SEL) += cpsw-phy-sel.o
1414
obj-$(CONFIG_TI_CPSW_ALE) += cpsw_ale.o
15-
obj-$(CONFIG_TI_CPTS) += cpts.o
15+
obj-$(CONFIG_TI_CPTS_MOD) += cpts.o
1616
obj-$(CONFIG_TI_CPSW) += ti_cpsw.o
1717
ti_cpsw-y := cpsw.o
1818

0 commit comments

Comments
 (0)