diff options
author | Richard Cochran <richardcochran@gmail.com> | 2015-04-01 00:08:11 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-01 00:19:18 +0300 |
commit | bdf36d947134baced573594118ff575f5c6cb77b (patch) | |
tree | dcd3231cd6967ae0fb467b2b2977237ef449bdc4 /drivers/net/ethernet | |
parent | 3359e7c2e904eac4e76d5b8b5e9390a622863df8 (diff) | |
download | linux-bdf36d947134baced573594118ff575f5c6cb77b.tar.xz |
ptp: e1000e: use helpers for converting ns to timespec.
This patch changes the driver to use ns_to_timespec64() instead of
open coding the same logic.
Compile tested only.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/ptp.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/ptp.c b/drivers/net/ethernet/intel/e1000e/ptp.c index 6fedc2c327dd..8d7b21dc7e19 100644 --- a/drivers/net/ethernet/intel/e1000e/ptp.c +++ b/drivers/net/ethernet/intel/e1000e/ptp.c @@ -111,15 +111,13 @@ static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) struct e1000_adapter *adapter = container_of(ptp, struct e1000_adapter, ptp_clock_info); unsigned long flags; - u32 remainder; u64 ns; spin_lock_irqsave(&adapter->systim_lock, flags); ns = timecounter_read(&adapter->tc); spin_unlock_irqrestore(&adapter->systim_lock, flags); - ts->tv_sec = div_u64_rem(ns, NSEC_PER_SEC, &remainder); - ts->tv_nsec = remainder; + *ts = ns_to_timespec64(ns); return 0; } |