]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ptp: deprecate gettime64() in favor of gettimex64()
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 9 Nov 2018 10:14:45 +0000 (11:14 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 10 Nov 2018 03:43:51 +0000 (19:43 -0800)
When a driver provides gettimex64(), use it in the PTP_SYS_OFFSET ioctl
and POSIX clock's gettime() instead of gettime64(). Drivers should
provide only one of the functions.

Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/ptp/ptp_chardev.c
drivers/ptp/ptp_clock.c
include/linux/ptp_clock_kernel.h

index aad0d36cf5c0df592350c551c47cf23f5fe15497..797fab33bb983913d50864ce7c6a792a6c3a6f95 100644 (file)
@@ -260,7 +260,10 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg)
                        pct->sec = ts.tv_sec;
                        pct->nsec = ts.tv_nsec;
                        pct++;
-                       err = ptp->info->gettime64(ptp->info, &ts);
+                       if (ops->gettimex64)
+                               err = ops->gettimex64(ops, &ts, NULL);
+                       else
+                               err = ops->gettime64(ops, &ts);
                        if (err)
                                goto out;
                        pct->sec = ts.tv_sec;
index 5419a89d300e3cb8769fa338e8616065cc28ec4c..40fda23e4b057b63edf3f54be020650981ed0a05 100644 (file)
@@ -117,7 +117,10 @@ static int ptp_clock_gettime(struct posix_clock *pc, struct timespec64 *tp)
        struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock);
        int err;
 
-       err = ptp->info->gettime64(ptp->info, tp);
+       if (ptp->info->gettimex64)
+               err = ptp->info->gettimex64(ptp->info, tp, NULL);
+       else
+               err = ptp->info->gettime64(ptp->info, tp);
        return err;
 }
 
index a1ec0448e341f8826ec3dda37e16365d8014ad95..7121bbe76979078babbaf4532d0601c4775933c2 100644 (file)
@@ -82,6 +82,8 @@ struct ptp_system_timestamp {
  *            parameter delta: Desired change in nanoseconds.
  *
  * @gettime64:  Reads the current time from the hardware clock.
+ *              This method is deprecated.  New drivers should implement
+ *              the @gettimex64 method instead.
  *              parameter ts: Holds the result.
  *
  * @gettimex64:  Reads the current time from the hardware clock and optionally