netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: dsa: sja1105: fix ptp link error
@ 2019-06-17 13:14 Arnd Bergmann
  2019-06-17 23:25 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2019-06-17 13:14 UTC (permalink / raw)
  To: Vladimir Oltean, Andrew Lunn, Vivien Didelot, Florian Fainelli,
	David S. Miller
  Cc: Arnd Bergmann, Georg Waibel, linux-kernel, netdev

Due to a reversed dependency, it is possible to build
the lower ptp driver as a loadable module and the actual
driver using it as built-in, causing a link error:

drivers/net/dsa/sja1105/sja1105_spi.o: In function `sja1105_static_config_upload':
sja1105_spi.c:(.text+0x6f0): undefined reference to `sja1105_ptp_reset'
drivers/net/dsa/sja1105/sja1105_spi.o:(.data+0x2d4): undefined reference to `sja1105et_ptp_cmd'
drivers/net/dsa/sja1105/sja1105_spi.o:(.data+0x604): undefined reference to `sja1105pqrs_ptp_cmd'
drivers/net/dsa/sja1105/sja1105_main.o: In function `sja1105_remove':
sja1105_main.c:(.text+0x8d4): undefined reference to `sja1105_ptp_clock_unregister'
drivers/net/dsa/sja1105/sja1105_main.o: In function `sja1105_rxtstamp_work':
sja1105_main.c:(.text+0x964): undefined reference to `sja1105_tstamp_reconstruct'
drivers/net/dsa/sja1105/sja1105_main.o: In function `sja1105_setup':
sja1105_main.c:(.text+0xb7c): undefined reference to `sja1105_ptp_clock_register'
drivers/net/dsa/sja1105/sja1105_main.o: In function `sja1105_port_deferred_xmit':
sja1105_main.c:(.text+0x1fa0): undefined reference to `sja1105_ptpegr_ts_poll'
sja1105_main.c:(.text+0x1fc4): undefined reference to `sja1105_tstamp_reconstruct'
drivers/net/dsa/sja1105/sja1105_main.o:(.rodata+0x5b0): undefined reference to `sja1105_get_ts_info'

Change the Makefile logic to always build the ptp module
the same way as the rest. Another option would be to
just add it to the same module and remove the exports,
but I don't know if there was a good reason to keep them
separate.

Fixes: bb77f36ac21d ("net: dsa: sja1105: Add support for the PTP clock")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/dsa/sja1105/Kconfig  | 2 +-
 drivers/net/dsa/sja1105/Makefile | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/dsa/sja1105/Kconfig b/drivers/net/dsa/sja1105/Kconfig
index 105e8d3e380e..770134a66e48 100644
--- a/drivers/net/dsa/sja1105/Kconfig
+++ b/drivers/net/dsa/sja1105/Kconfig
@@ -18,7 +18,7 @@ tristate "NXP SJA1105 Ethernet switch family support"
 	    - SJA1105S (Gen. 2, SGMII, TT-Ethernet)
 
 config NET_DSA_SJA1105_PTP
-tristate "Support for the PTP clock on the NXP SJA1105 Ethernet switch"
+	bool "Support for the PTP clock on the NXP SJA1105 Ethernet switch"
 	depends on NET_DSA_SJA1105
 	help
 	  This enables support for timestamping and PTP clock manipulations in
diff --git a/drivers/net/dsa/sja1105/Makefile b/drivers/net/dsa/sja1105/Makefile
index 946eea7d8480..9a22f68b39e9 100644
--- a/drivers/net/dsa/sja1105/Makefile
+++ b/drivers/net/dsa/sja1105/Makefile
@@ -1,6 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 obj-$(CONFIG_NET_DSA_SJA1105) += sja1105.o
-obj-$(CONFIG_NET_DSA_SJA1105_PTP) += sja1105_ptp.o
 
 sja1105-objs := \
     sja1105_spi.o \
@@ -9,3 +8,7 @@ sja1105-objs := \
     sja1105_clocking.o \
     sja1105_static_config.o \
     sja1105_dynamic_config.o \
+
+ifdef CONFIG_NET_DSA_SJA1105_PTP
+obj-$(CONFIG_NET_DSA_SJA1105) += sja1105_ptp.o
+endif
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: dsa: sja1105: fix ptp link error
  2019-06-17 13:14 [PATCH net-next] net: dsa: sja1105: fix ptp link error Arnd Bergmann
@ 2019-06-17 23:25 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-06-17 23:25 UTC (permalink / raw)
  To: arnd
  Cc: olteanv, andrew, vivien.didelot, f.fainelli, georg.waibel,
	linux-kernel, netdev

From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 17 Jun 2019 15:14:10 +0200

> Due to a reversed dependency, it is possible to build
> the lower ptp driver as a loadable module and the actual
> driver using it as built-in, causing a link error:
> 
> drivers/net/dsa/sja1105/sja1105_spi.o: In function `sja1105_static_config_upload':
> sja1105_spi.c:(.text+0x6f0): undefined reference to `sja1105_ptp_reset'
> drivers/net/dsa/sja1105/sja1105_spi.o:(.data+0x2d4): undefined reference to `sja1105et_ptp_cmd'
> drivers/net/dsa/sja1105/sja1105_spi.o:(.data+0x604): undefined reference to `sja1105pqrs_ptp_cmd'
> drivers/net/dsa/sja1105/sja1105_main.o: In function `sja1105_remove':
> sja1105_main.c:(.text+0x8d4): undefined reference to `sja1105_ptp_clock_unregister'
> drivers/net/dsa/sja1105/sja1105_main.o: In function `sja1105_rxtstamp_work':
> sja1105_main.c:(.text+0x964): undefined reference to `sja1105_tstamp_reconstruct'
> drivers/net/dsa/sja1105/sja1105_main.o: In function `sja1105_setup':
> sja1105_main.c:(.text+0xb7c): undefined reference to `sja1105_ptp_clock_register'
> drivers/net/dsa/sja1105/sja1105_main.o: In function `sja1105_port_deferred_xmit':
> sja1105_main.c:(.text+0x1fa0): undefined reference to `sja1105_ptpegr_ts_poll'
> sja1105_main.c:(.text+0x1fc4): undefined reference to `sja1105_tstamp_reconstruct'
> drivers/net/dsa/sja1105/sja1105_main.o:(.rodata+0x5b0): undefined reference to `sja1105_get_ts_info'
> 
> Change the Makefile logic to always build the ptp module
> the same way as the rest. Another option would be to
> just add it to the same module and remove the exports,
> but I don't know if there was a good reason to keep them
> separate.
> 
> Fixes: bb77f36ac21d ("net: dsa: sja1105: Add support for the PTP clock")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-17 23:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-17 13:14 [PATCH net-next] net: dsa: sja1105: fix ptp link error Arnd Bergmann
2019-06-17 23:25 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).