Skip to content

Commit d68fb11

Browse files
committed
ptp: Fix clock_getres() implementation
The clock_getres() function must return the resolution in the timespec argument and return 0 for success. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: John Stultz <john.stultz@linaro.org> Cc: stable@kernel.org Cc: Richard Cochran <richard.cochran@omicron.at>
1 parent 45e713e commit d68fb11

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎drivers/ptp/ptp_clock.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ static s32 scaled_ppm_to_ppb(long ppm)
101101

102102
static int ptp_clock_getres(struct posix_clock *pc, struct timespec *tp)
103103
{
104-
return 1; /* always round timer functions to one nanosecond */
104+
tp->tv_sec = 0;
105+
tp->tv_nsec = 1;
106+
return 0;
105107
}
106108

107109
static int ptp_clock_settime(struct posix_clock *pc, const struct timespec *tp)

0 commit comments

Comments
 (0)