netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net/master] net: ethernet: ti: cpts: Fix linker issue when TI_CPTS is defined
@ 2020-05-07 21:47 Dan Murphy
  2020-05-08  0:31 ` Dan Murphy
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Murphy @ 2020-05-07 21:47 UTC (permalink / raw)
  To: davem, richardcochran, ivan.khoronzhuk
  Cc: netdev, linux-kernel, Dan Murphy, Grygorii Strashko

Fix build issue when CONFIG_TI_CPTS is defined in the defconfig but
CONFIG_TI_CPTS_MOD is not set.

arm-none-linux-gnueabihf-ld: drivers/net/ethernet/ti/cpsw.o: in function `cpsw_ndo_stop':
drivers/net/ethernet/ti/cpsw.c:886: undefined reference to `cpts_unregister'
arm-none-linux-gnueabihf-ld: drivers/net/ethernet/ti/cpsw.o: in function `cpsw_remove':
drivers/net/ethernet/ti/cpsw.c:1742: undefined reference to `cpts_release'
arm-none-linux-gnueabihf-ld: drivers/net/ethernet/ti/cpsw.o: in function `cpsw_rx_handler':
drivers/net/ethernet/ti/cpsw.c:437: undefined reference to `cpts_rx_timestamp'
arm-none-linux-gnueabihf-ld: drivers/net/ethernet/ti/cpsw.o: in function `cpsw_ndo_open':
drivers/net/ethernet/ti/cpsw.c:840: undefined reference to `cpts_register'
arm-none-linux-gnueabihf-ld: drivers/net/ethernet/ti/cpsw.o: in function `cpsw_probe':
drivers/net/ethernet/ti/cpsw.c:1717: undefined reference to `cpts_release'
arm-none-linux-gnueabihf-ld: drivers/net/ethernet/ti/cpsw_priv.o: in function `cpsw_tx_handler':
drivers/net/ethernet/ti/cpsw_priv.c:68: undefined reference to `cpts_tx_timestamp'
arm-none-linux-gnueabihf-ld: drivers/net/ethernet/ti/cpsw_priv.o: in function `cpsw_init_common':
drivers/net/ethernet/ti/cpsw_priv.c:525: undefined reference to `cpts_create'
arm-none-linux-gnueabihf-ld: drivers/net/ethernet/ti/cpsw_new.o: in function `cpsw_ndo_stop':
drivers/net/ethernet/ti/cpsw_new.c:814: undefined reference to `cpts_unregister'
arm-none-linux-gnueabihf-ld: drivers/net/ethernet/ti/cpsw_new.o: in function `cpsw_remove':
drivers/net/ethernet/ti/cpsw_new.c:2029: undefined reference to `cpts_release'
arm-none-linux-gnueabihf-ld: drivers/net/ethernet/ti/cpsw_new.o: in function `cpsw_rx_handler':
drivers/net/ethernet/ti/cpsw_new.c:379: undefined reference to `cpts_rx_timestamp'
arm-none-linux-gnueabihf-ld: drivers/net/ethernet/ti/cpsw_new.o: in function `cpsw_probe':
drivers/net/ethernet/ti/cpsw_new.c:2005: undefined reference to `cpts_release'
arm-none-linux-gnueabihf-ld: drivers/net/ethernet/ti/cpsw_new.o: in function `cpsw_ndo_open':
drivers/net/ethernet/ti/cpsw_new.c:874: undefined reference to `cpts_register'

The header file needs to check if the CONFIG_TI_CPTS_MOD is set in order
to build the prototypes.  If not then the inline functions should be
used.

Once this change was made then a follow up error occured due to the same
flag error in the code.

drivers/net/ethernet/ti/cpsw_ethtool.c:724:30: error: dereferencing pointer to incomplete type ‘struct cpts’
 info->phc_index = cpsw->cpts->phc_index;

CC: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 drivers/net/ethernet/ti/cpsw_ethtool.c | 2 +-
 drivers/net/ethernet/ti/cpts.h         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw_ethtool.c b/drivers/net/ethernet/ti/cpsw_ethtool.c
index fa54efe3be63..31e8a76d4407 100644
--- a/drivers/net/ethernet/ti/cpsw_ethtool.c
+++ b/drivers/net/ethernet/ti/cpsw_ethtool.c
@@ -709,7 +709,7 @@ int cpsw_set_ringparam(struct net_device *ndev,
 	return ret;
 }
 
-#if IS_ENABLED(CONFIG_TI_CPTS)
+#if IS_ENABLED(CONFIG_TI_CPTS_MOD)
 int cpsw_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info)
 {
 	struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
diff --git a/drivers/net/ethernet/ti/cpts.h b/drivers/net/ethernet/ti/cpts.h
index bb997c11ee15..548af47fa938 100644
--- a/drivers/net/ethernet/ti/cpts.h
+++ b/drivers/net/ethernet/ti/cpts.h
@@ -8,7 +8,7 @@
 #ifndef _TI_CPTS_H_
 #define _TI_CPTS_H_
 
-#if IS_ENABLED(CONFIG_TI_CPTS)
+#if IS_ENABLED(CONFIG_TI_CPTS_MOD)
 
 #include <linux/clk.h>
 #include <linux/clkdev.h>
-- 
2.25.1


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

* Re: [PATCH net/master] net: ethernet: ti: cpts: Fix linker issue when TI_CPTS is defined
  2020-05-07 21:47 [PATCH net/master] net: ethernet: ti: cpts: Fix linker issue when TI_CPTS is defined Dan Murphy
@ 2020-05-08  0:31 ` Dan Murphy
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Murphy @ 2020-05-08  0:31 UTC (permalink / raw)
  To: davem, richardcochran, ivan.khoronzhuk
  Cc: netdev, linux-kernel, Grygorii Strashko

All

On 5/7/20 4:47 PM, Dan Murphy wrote:
> Fix build issue when CONFIG_TI_CPTS is defined in the defconfig but
> CONFIG_TI_CPTS_MOD is not set.

I see this already has a pending patch to fix this so unless this 
solution is better I will drop the patch

https://lore.kernel.org/patchwork/patch/1235642/

Dan


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

end of thread, other threads:[~2020-05-08  0:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 21:47 [PATCH net/master] net: ethernet: ti: cpts: Fix linker issue when TI_CPTS is defined Dan Murphy
2020-05-08  0:31 ` Dan Murphy

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).