Skip to content

Commit

Permalink
dp83640: Use generic ptp_msg_is_sync() function
Browse files Browse the repository at this point in the history
Use generic ptp_msg_is_sync() function to avoid code duplication.

Signed-off-by: Kurt Kanzenbach <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
shifty91 authored and davem330 committed Mar 7, 2022
1 parent f72de02 commit 1246b22
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions drivers/net/phy/dp83640.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,17 +970,6 @@ static void decode_status_frame(struct dp83640_private *dp83640,
}
}

static int is_sync(struct sk_buff *skb, int type)
{
struct ptp_header *hdr;

hdr = ptp_parse_header(skb, type);
if (!hdr)
return 0;

return ptp_get_msgtype(hdr, type) == PTP_MSGTYPE_SYNC;
}

static void dp83640_free_clocks(void)
{
struct dp83640_clock *clock;
Expand Down Expand Up @@ -1396,7 +1385,7 @@ static void dp83640_txtstamp(struct mii_timestamper *mii_ts,
switch (dp83640->hwts_tx_en) {

case HWTSTAMP_TX_ONESTEP_SYNC:
if (is_sync(skb, type)) {
if (ptp_msg_is_sync(skb, type)) {
kfree_skb(skb);
return;
}
Expand Down

0 comments on commit 1246b22

Please sign in to comment.