diff options
author | Kurt Kanzenbach <kurt@linutronix.de> | 2022-03-05 12:21:27 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-03-07 11:31:34 +0000 |
commit | 3914a9c07e8c3a30f178f1c92e2354b9cffdecb5 (patch) | |
tree | 78c6c8f0eee3afb62c390ac91c80267e80b2fb41 /drivers/net/phy/micrel.c | |
parent | 1246b229c6e8712f4da2d2a0d0b2542ff3daa837 (diff) | |
download | linux-3914a9c07e8c3a30f178f1c92e2354b9cffdecb5.tar.gz linux-3914a9c07e8c3a30f178f1c92e2354b9cffdecb5.tar.bz2 linux-3914a9c07e8c3a30f178f1c92e2354b9cffdecb5.zip |
micrel: Use generic ptp_msg_is_sync() function
Use generic ptp_msg_is_sync() function to avoid code duplication.
Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/micrel.c')
-rw-r--r-- | drivers/net/phy/micrel.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 81a76322254c..9e6b29b23935 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -1976,17 +1976,6 @@ static int lan8814_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr) return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ? -EFAULT : 0; } -static bool is_sync(struct sk_buff *skb, int type) -{ - struct ptp_header *hdr; - - hdr = ptp_parse_header(skb, type); - if (!hdr) - return false; - - return ((ptp_get_msgtype(hdr, type) & 0xf) == 0); -} - static void lan8814_txtstamp(struct mii_timestamper *mii_ts, struct sk_buff *skb, int type) { @@ -1994,7 +1983,7 @@ static void lan8814_txtstamp(struct mii_timestamper *mii_ts, switch (ptp_priv->hwts_tx_type) { case HWTSTAMP_TX_ONESTEP_SYNC: - if (is_sync(skb, type)) { + if (ptp_msg_is_sync(skb, type)) { kfree_skb(skb); return; } |