Skip to content

Commit 5c35bad

Browse files
richardcochrandavem330
authored andcommitted
ptp: provide the clock's adjusted frequency
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]>
1 parent 39a8cbd commit 5c35bad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/ptp/ptp_clock.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,12 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct timex *tx)
143143
kt = timespec_to_ktime(ts);
144144
delta = ktime_to_ns(kt);
145145
err = ops->adjtime(ops, delta);
146-
147146
} else if (tx->modes & ADJ_FREQUENCY) {
148-
149147
err = ops->adjfreq(ops, scaled_ppm_to_ppb(tx->freq));
150148
ptp->dialed_frequency = tx->freq;
149+
} else if (tx->modes == 0) {
150+
tx->freq = ptp->dialed_frequency;
151+
err = 0;
151152
}
152153

153154
return err;

0 commit comments

Comments
 (0)