lkml.org 
[lkml]   [2011]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PTP] Implement clock_getres() function correctly
From
Date
On Sun, 2011-12-04 at 18:07 +0100, Thomas Gleixner wrote:
> On Sun, 4 Dec 2011, Thomas Gleixner wrote:
>
> > clock_getres() needs to put the resolution into the provided timespec
> > and return 0 in case of success.
> >
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Cc: stable@vger.kernel.org
>
> Gah, wrong version.
>
> diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
> index cf3f999..6b0c02a 100644
> --- a/drivers/ptp/ptp_clock.c
> +++ b/drivers/ptp/ptp_clock.c
> @@ -101,7 +101,10 @@ 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 */
> + /* Resolution is 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)


Looks good.

Acked-by: John Stultz <john.stultz@linaro.org>




\
 
 \ /
  Last update: 2011-12-05 20:05    [W:0.315 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site