net: loopback: use generic helper to report timestamping info
authorJulian Wiedmann <jwi@linux.ibm.com>
Fri, 12 Apr 2019 11:06:14 +0000 (13:06 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Apr 2019 23:26:37 +0000 (16:26 -0700)
For reporting the common set of SW timestamping capabilities, use
ethtool_op_get_ts_info() instead of re-implementing it.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/loopback.c

index 2df7f60fe05220c19896a251b6b15239f4b95112..857e4bf998835eaeb6c4bf776dd77adabb0f36c9 100644 (file)
@@ -128,21 +128,9 @@ static u32 always_on(struct net_device *dev)
        return 1;
 }
 
-static int loopback_get_ts_info(struct net_device *netdev,
-                               struct ethtool_ts_info *ts_info)
-{
-       ts_info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
-                                  SOF_TIMESTAMPING_RX_SOFTWARE |
-                                  SOF_TIMESTAMPING_SOFTWARE;
-
-       ts_info->phc_index = -1;
-
-       return 0;
-};
-
 static const struct ethtool_ops loopback_ethtool_ops = {
        .get_link               = always_on,
-       .get_ts_info            = loopback_get_ts_info,
+       .get_ts_info            = ethtool_op_get_ts_info,
 };
 
 static int loopback_dev_init(struct net_device *dev)