Skip to content

Commit

Permalink
ptp: provide the clock's adjusted frequency
Browse files Browse the repository at this point in the history
If the timex.mode field indicates a query, then we provide the value of
the current frequency adjustment.

[ Get rid of extraneous empty lines -DaveM ]

Signed-off-by: Richard Cochran <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
richardcochran authored and davem330 committed Sep 22, 2012
1 parent 39a8cbd commit 5c35bad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/ptp/ptp_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,12 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct timex *tx)
kt = timespec_to_ktime(ts);
delta = ktime_to_ns(kt);
err = ops->adjtime(ops, delta);

} else if (tx->modes & ADJ_FREQUENCY) {

err = ops->adjfreq(ops, scaled_ppm_to_ppb(tx->freq));
ptp->dialed_frequency = tx->freq;
} else if (tx->modes == 0) {
tx->freq = ptp->dialed_frequency;
err = 0;
}

return err;
Expand Down

0 comments on commit 5c35bad

Please sign in to comment.