aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/freescale
diff options
context:
space:
mode:
authorRichard Cochran <richardcochran@gmail.com>2015-03-29 17:11:59 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-31 12:01:17 -0400
commitd28fdf0fe3dc73df8f0e41424ec0bba0660baabe (patch)
tree6b8973490d02ef16b9400af8a14a3e01197b8426 /drivers/net/ethernet/freescale
parent241926bcb4546187363d6140a610e4bb7d12d85e (diff)
ptp: gianfar: convert to the 64 bit get/set time methods.
The device features a 64 bit nanoseconds register, and so with this patch the driver is ready for the year 2038. Signed-off-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r--drivers/net/ethernet/freescale/gianfar_ptp.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar_ptp.c b/drivers/net/ethernet/freescale/gianfar_ptp.c
index 77353366f33b..04265a7275e5 100644
--- a/drivers/net/ethernet/freescale/gianfar_ptp.c
+++ b/drivers/net/ethernet/freescale/gianfar_ptp.c
@@ -322,7 +322,8 @@ static int ptp_gianfar_adjtime(struct ptp_clock_info *ptp, s64 delta)
322 return 0; 322 return 0;
323} 323}
324 324
325static int ptp_gianfar_gettime(struct ptp_clock_info *ptp, struct timespec *ts) 325static int ptp_gianfar_gettime(struct ptp_clock_info *ptp,
326 struct timespec64 *ts)
326{ 327{
327 u64 ns; 328 u64 ns;
328 u32 remainder; 329 u32 remainder;
@@ -341,7 +342,7 @@ static int ptp_gianfar_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
341} 342}
342 343
343static int ptp_gianfar_settime(struct ptp_clock_info *ptp, 344static int ptp_gianfar_settime(struct ptp_clock_info *ptp,
344 const struct timespec *ts) 345 const struct timespec64 *ts)
345{ 346{
346 u64 ns; 347 u64 ns;
347 unsigned long flags; 348 unsigned long flags;
@@ -418,8 +419,8 @@ static struct ptp_clock_info ptp_gianfar_caps = {
418 .pps = 1, 419 .pps = 1,
419 .adjfreq = ptp_gianfar_adjfreq, 420 .adjfreq = ptp_gianfar_adjfreq,
420 .adjtime = ptp_gianfar_adjtime, 421 .adjtime = ptp_gianfar_adjtime,
421 .gettime = ptp_gianfar_gettime, 422 .gettime64 = ptp_gianfar_gettime,
422 .settime = ptp_gianfar_settime, 423 .settime64 = ptp_gianfar_settime,
423 .enable = ptp_gianfar_enable, 424 .enable = ptp_gianfar_enable,
424}; 425};
425 426
@@ -440,7 +441,7 @@ static int gianfar_ptp_probe(struct platform_device *dev)
440{ 441{
441 struct device_node *node = dev->dev.of_node; 442 struct device_node *node = dev->dev.of_node;
442 struct etsects *etsects; 443 struct etsects *etsects;
443 struct timespec now; 444 struct timespec64 now;
444 int err = -ENOMEM; 445 int err = -ENOMEM;
445 u32 tmr_ctrl; 446 u32 tmr_ctrl;
446 unsigned long flags; 447 unsigned long flags;
@@ -495,7 +496,7 @@ static int gianfar_ptp_probe(struct platform_device *dev)
495 pr_err("ioremap ptp registers failed\n"); 496 pr_err("ioremap ptp registers failed\n");
496 goto no_ioremap; 497 goto no_ioremap;
497 } 498 }
498 getnstimeofday(&now); 499 getnstimeofday64(&now);
499 ptp_gianfar_settime(&etsects->caps, &now); 500 ptp_gianfar_settime(&etsects->caps, &now);
500 501
501 tmr_ctrl = 502 tmr_ctrl =