aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Cochran <richardcochran@gmail.com>2015-03-29 17:12:01 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-31 12:01:17 -0400
commit843293e1bb7d8cccc3b4a528db9eef710113fb6a (patch)
tree1e818d047b67596b3f7aee1792ec2afa92d2cbfb
parent07c74eb775dd4a58c331529973111166f3683541 (diff)
ptp: fm10k: convert to the 64 bit get/set time methods.
The device appears to use a 64 bit nanoseconds register, and so with this patch the driver should be ready for the year 2038. Compile tested only. Signed-off-by: Richard Cochran <richardcochran@gmail.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/intel/fm10k/fm10k_ptp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_ptp.c b/drivers/net/ethernet/intel/fm10k/fm10k_ptp.c
index d966044e017a..02008e976d18 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_ptp.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_ptp.c
@@ -285,7 +285,7 @@ static int fm10k_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
285 return 0; 285 return 0;
286} 286}
287 287
288static int fm10k_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts) 288static int fm10k_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
289{ 289{
290 struct fm10k_intfc *interface; 290 struct fm10k_intfc *interface;
291 unsigned long flags; 291 unsigned long flags;
@@ -297,17 +297,17 @@ static int fm10k_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
297 now = fm10k_systime_read(interface) + interface->ptp_adjust; 297 now = fm10k_systime_read(interface) + interface->ptp_adjust;
298 read_unlock_irqrestore(&interface->systime_lock, flags); 298 read_unlock_irqrestore(&interface->systime_lock, flags);
299 299
300 *ts = ns_to_timespec(now); 300 *ts = ns_to_timespec64(now);
301 301
302 return 0; 302 return 0;
303} 303}
304 304
305static int fm10k_ptp_settime(struct ptp_clock_info *ptp, 305static int fm10k_ptp_settime(struct ptp_clock_info *ptp,
306 const struct timespec *ts) 306 const struct timespec64 *ts)
307{ 307{
308 struct fm10k_intfc *interface; 308 struct fm10k_intfc *interface;
309 unsigned long flags; 309 unsigned long flags;
310 u64 ns = timespec_to_ns(ts); 310 u64 ns = timespec64_to_ns(ts);
311 311
312 interface = container_of(ptp, struct fm10k_intfc, ptp_caps); 312 interface = container_of(ptp, struct fm10k_intfc, ptp_caps);
313 313
@@ -419,8 +419,8 @@ void fm10k_ptp_register(struct fm10k_intfc *interface)
419 ptp_caps->max_adj = 976562; 419 ptp_caps->max_adj = 976562;
420 ptp_caps->adjfreq = fm10k_ptp_adjfreq; 420 ptp_caps->adjfreq = fm10k_ptp_adjfreq;
421 ptp_caps->adjtime = fm10k_ptp_adjtime; 421 ptp_caps->adjtime = fm10k_ptp_adjtime;
422 ptp_caps->gettime = fm10k_ptp_gettime; 422 ptp_caps->gettime64 = fm10k_ptp_gettime;
423 ptp_caps->settime = fm10k_ptp_settime; 423 ptp_caps->settime64 = fm10k_ptp_settime;
424 424
425 /* provide pins if BAR4 is accessible */ 425 /* provide pins if BAR4 is accessible */
426 if (interface->sw_addr) { 426 if (interface->sw_addr) {