Skip to content

Commit

Permalink
ptp: Fix clock_getres() implementation
Browse files Browse the repository at this point in the history
The clock_getres() function must return the resolution in the timespec
argument and return 0 for success.

Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: John Stultz <[email protected]>
Cc: [email protected]
Cc: Richard Cochran <[email protected]>
  • Loading branch information
KAGA-KOKO committed Dec 6, 2011
1 parent 45e713e commit d68fb11
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/ptp/ptp_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ static s32 scaled_ppm_to_ppb(long ppm)

static int ptp_clock_getres(struct posix_clock *pc, struct timespec *tp)
{
return 1; /* always round timer functions to one nanosecond */
tp->tv_sec = 0;
tp->tv_nsec = 1;
return 0;
}

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

0 comments on commit d68fb11

Please sign in to comment.