aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Cochran <richardcochran@gmail.com>2015-03-29 17:12:08 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-31 12:01:18 -0400
commita5c79c26e168018df201c07e046003a6ab226cdc (patch)
tree2c48b9b9a671cac6b5ea8dd296d05c17dc4723da
parent3f6c4654c8bff4230ba279a7b5b6d8721b572ddf (diff)
ptp: cpts: 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>
-rw-r--r--drivers/net/ethernet/ti/cpts.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index fbe42cb107ec..074b6369da66 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -167,7 +167,7 @@ static int cpts_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
167 return 0; 167 return 0;
168} 168}
169 169
170static int cpts_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts) 170static int cpts_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
171{ 171{
172 u64 ns; 172 u64 ns;
173 u32 remainder; 173 u32 remainder;
@@ -185,7 +185,7 @@ static int cpts_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
185} 185}
186 186
187static int cpts_ptp_settime(struct ptp_clock_info *ptp, 187static int cpts_ptp_settime(struct ptp_clock_info *ptp,
188 const struct timespec *ts) 188 const struct timespec64 *ts)
189{ 189{
190 u64 ns; 190 u64 ns;
191 unsigned long flags; 191 unsigned long flags;
@@ -216,20 +216,20 @@ static struct ptp_clock_info cpts_info = {
216 .pps = 0, 216 .pps = 0,
217 .adjfreq = cpts_ptp_adjfreq, 217 .adjfreq = cpts_ptp_adjfreq,
218 .adjtime = cpts_ptp_adjtime, 218 .adjtime = cpts_ptp_adjtime,
219 .gettime = cpts_ptp_gettime, 219 .gettime64 = cpts_ptp_gettime,
220 .settime = cpts_ptp_settime, 220 .settime64 = cpts_ptp_settime,
221 .enable = cpts_ptp_enable, 221 .enable = cpts_ptp_enable,
222}; 222};
223 223
224static void cpts_overflow_check(struct work_struct *work) 224static void cpts_overflow_check(struct work_struct *work)
225{ 225{
226 struct timespec ts; 226 struct timespec64 ts;
227 struct cpts *cpts = container_of(work, struct cpts, overflow_work.work); 227 struct cpts *cpts = container_of(work, struct cpts, overflow_work.work);
228 228
229 cpts_write32(cpts, CPTS_EN, control); 229 cpts_write32(cpts, CPTS_EN, control);
230 cpts_write32(cpts, TS_PEND_EN, int_enable); 230 cpts_write32(cpts, TS_PEND_EN, int_enable);
231 cpts_ptp_gettime(&cpts->info, &ts); 231 cpts_ptp_gettime(&cpts->info, &ts);
232 pr_debug("cpts overflow check at %ld.%09lu\n", ts.tv_sec, ts.tv_nsec); 232 pr_debug("cpts overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec);
233 schedule_delayed_work(&cpts->overflow_work, CPTS_OVERFLOW_PERIOD); 233 schedule_delayed_work(&cpts->overflow_work, CPTS_OVERFLOW_PERIOD);
234} 234}
235 235