diff options
author | Richard Cochran <richardcochran@gmail.com> | 2015-03-29 17:11:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-31 12:01:16 -0400 |
commit | 15dd95ffe424e336b2a2bc7a01603c0e1314901c (patch) | |
tree | 8b3c1e284bfd9372bc060fc5646db03e250ee97e /drivers/net/ethernet | |
parent | 20ca7fb6e4d6e8c44442ac0b82c24e74de2bad02 (diff) |
ptp: xgbe: convert to the 64 bit get/set time methods.
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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-ptp.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c b/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c index f326178ef376..b03e4f58d02e 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c | |||
@@ -179,7 +179,7 @@ static int xgbe_adjtime(struct ptp_clock_info *info, s64 delta) | |||
179 | return 0; | 179 | return 0; |
180 | } | 180 | } |
181 | 181 | ||
182 | static int xgbe_gettime(struct ptp_clock_info *info, struct timespec *ts) | 182 | static int xgbe_gettime(struct ptp_clock_info *info, struct timespec64 *ts) |
183 | { | 183 | { |
184 | struct xgbe_prv_data *pdata = container_of(info, | 184 | struct xgbe_prv_data *pdata = container_of(info, |
185 | struct xgbe_prv_data, | 185 | struct xgbe_prv_data, |
@@ -193,12 +193,13 @@ static int xgbe_gettime(struct ptp_clock_info *info, struct timespec *ts) | |||
193 | 193 | ||
194 | spin_unlock_irqrestore(&pdata->tstamp_lock, flags); | 194 | spin_unlock_irqrestore(&pdata->tstamp_lock, flags); |
195 | 195 | ||
196 | *ts = ns_to_timespec(nsec); | 196 | *ts = ns_to_timespec64(nsec); |
197 | 197 | ||
198 | return 0; | 198 | return 0; |
199 | } | 199 | } |
200 | 200 | ||
201 | static int xgbe_settime(struct ptp_clock_info *info, const struct timespec *ts) | 201 | static int xgbe_settime(struct ptp_clock_info *info, |
202 | const struct timespec64 *ts) | ||
202 | { | 203 | { |
203 | struct xgbe_prv_data *pdata = container_of(info, | 204 | struct xgbe_prv_data *pdata = container_of(info, |
204 | struct xgbe_prv_data, | 205 | struct xgbe_prv_data, |
@@ -206,7 +207,7 @@ static int xgbe_settime(struct ptp_clock_info *info, const struct timespec *ts) | |||
206 | unsigned long flags; | 207 | unsigned long flags; |
207 | u64 nsec; | 208 | u64 nsec; |
208 | 209 | ||
209 | nsec = timespec_to_ns(ts); | 210 | nsec = timespec64_to_ns(ts); |
210 | 211 | ||
211 | spin_lock_irqsave(&pdata->tstamp_lock, flags); | 212 | spin_lock_irqsave(&pdata->tstamp_lock, flags); |
212 | 213 | ||
@@ -236,8 +237,8 @@ void xgbe_ptp_register(struct xgbe_prv_data *pdata) | |||
236 | info->max_adj = pdata->ptpclk_rate; | 237 | info->max_adj = pdata->ptpclk_rate; |
237 | info->adjfreq = xgbe_adjfreq; | 238 | info->adjfreq = xgbe_adjfreq; |
238 | info->adjtime = xgbe_adjtime; | 239 | info->adjtime = xgbe_adjtime; |
239 | info->gettime = xgbe_gettime; | 240 | info->gettime64 = xgbe_gettime; |
240 | info->settime = xgbe_settime; | 241 | info->settime64 = xgbe_settime; |
241 | info->enable = xgbe_enable; | 242 | info->enable = xgbe_enable; |
242 | 243 | ||
243 | clock = ptp_clock_register(info, pdata->dev); | 244 | clock = ptp_clock_register(info, pdata->dev); |