diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-08-14 00:19:22 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-14 06:43:47 +0300 |
commit | 9dc502d79778324df7db4e093ffddf5413a1cd5f (patch) | |
tree | 88ffaffaa9e72e4439386e85c71adc4937b7e576 /drivers/net/ethernet/microchip/lan743x_ptp.h | |
parent | 3aad924025e2865e80212b9154749303618a1826 (diff) | |
download | linux-9dc502d79778324df7db4e093ffddf5413a1cd5f.tar.xz |
net: lan743x: fix building without CONFIG_PTP_1588_CLOCK
Building without CONFIG_PTP_1588_CLOCK results in multiple failures,
this was obviously not well tested:
drivers/net/ethernet/microchip/lan743x_ptp.c: In function 'lan743x_ptp_isr':
drivers/net/ethernet/microchip/lan743x_ptp.c:781:28: error: 'struct lan743x_ptp' has no member named 'ptp_clock'; did you mean 'tx_ts_lock'?
ptp_schedule_worker(ptp->ptp_clock, 0);
^~~~~~~~~
tx_ts_lock
drivers/net/ethernet/microchip/lan743x_ptp.c: In function 'lan743x_ptp_open':
drivers/net/ethernet/microchip/lan743x_ptp.c:879:6: error: unused variable 'ret' [-Werror=unused-variable]
int ret = -ENODEV;
^~~
At top level:
drivers/net/ethernet/microchip/lan743x_ptp.c:63:13: error: 'lan743x_ptp_tx_ts_enqueue_ts' defined but not used [-Werror=unused-function]
static void lan743x_ptp_tx_ts_enqueue_ts(struct lan743x_adapter *adapter,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
drivers/net/ethernet/microchip/lan743x_ethtool.c: In function 'lan743x_ethtool_get_ts_info':
drivers/net/ethernet/microchip/lan743x_ethtool.c:558:19: error: 'struct lan743x_ptp' has no member named 'ptp_clock'; did you mean 'tx_ts_lock'?
Those #ifdef checks are hard to get right, replace them all with
IS_ENABLED() checks that leave the same code visible to the compiler
but let it optimize out the unused bits based on the configuration.
Fixes: 07624df1c9ef ("lan743x: lan743x: Add PTP support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/microchip/lan743x_ptp.h')
-rw-r--r-- | drivers/net/ethernet/microchip/lan743x_ptp.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/net/ethernet/microchip/lan743x_ptp.h b/drivers/net/ethernet/microchip/lan743x_ptp.h index 20f2223024dc..5fc1b3cd5e33 100644 --- a/drivers/net/ethernet/microchip/lan743x_ptp.h +++ b/drivers/net/ethernet/microchip/lan743x_ptp.h @@ -49,11 +49,9 @@ struct lan743x_ptp { /* command_lock: used to prevent concurrent ptp commands */ struct mutex command_lock; -#ifdef CONFIG_PTP_1588_CLOCK struct ptp_clock *ptp_clock; struct ptp_clock_info ptp_clock_info; struct ptp_pin_desc pin_config[1]; -#endif /* CONFIG_PTP_1588_CLOCK */ #define LAN743X_PTP_NUMBER_OF_EVENT_CHANNELS (2) unsigned long used_event_ch; |