ptp: xgbe: convert to the 64 bit get/set time methods.
authorRichard Cochran <richardcochran@gmail.com>
Sun, 29 Mar 2015 21:11:55 +0000 (23:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Mar 2015 16:01:16 +0000 (12:01 -0400)
This driver's clock is implemented using a timecounter, and so with
this patch the driver is ready for the year 2038.

Compile tested only.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/xgbe/xgbe-ptp.c

index f326178ef3760122f034a27d5c5afeda4eb9aa70..b03e4f58d02ea550b4a19d7e4f7113ec3b48e4e0 100644 (file)
@@ -179,7 +179,7 @@ static int xgbe_adjtime(struct ptp_clock_info *info, s64 delta)
        return 0;
 }
 
-static int xgbe_gettime(struct ptp_clock_info *info, struct timespec *ts)
+static int xgbe_gettime(struct ptp_clock_info *info, struct timespec64 *ts)
 {
        struct xgbe_prv_data *pdata = container_of(info,
                                                   struct xgbe_prv_data,
@@ -193,12 +193,13 @@ static int xgbe_gettime(struct ptp_clock_info *info, struct timespec *ts)
 
        spin_unlock_irqrestore(&pdata->tstamp_lock, flags);
 
-       *ts = ns_to_timespec(nsec);
+       *ts = ns_to_timespec64(nsec);
 
        return 0;
 }
 
-static int xgbe_settime(struct ptp_clock_info *info, const struct timespec *ts)
+static int xgbe_settime(struct ptp_clock_info *info,
+                       const struct timespec64 *ts)
 {
        struct xgbe_prv_data *pdata = container_of(info,
                                                   struct xgbe_prv_data,
@@ -206,7 +207,7 @@ static int xgbe_settime(struct ptp_clock_info *info, const struct timespec *ts)
        unsigned long flags;
        u64 nsec;
 
-       nsec = timespec_to_ns(ts);
+       nsec = timespec64_to_ns(ts);
 
        spin_lock_irqsave(&pdata->tstamp_lock, flags);
 
@@ -236,8 +237,8 @@ void xgbe_ptp_register(struct xgbe_prv_data *pdata)
        info->max_adj = pdata->ptpclk_rate;
        info->adjfreq = xgbe_adjfreq;
        info->adjtime = xgbe_adjtime;
-       info->gettime = xgbe_gettime;
-       info->settime = xgbe_settime;
+       info->gettime64 = xgbe_gettime;
+       info->settime64 = xgbe_settime;
        info->enable = xgbe_enable;
 
        clock = ptp_clock_register(info, pdata->dev);