can: m_can: m_can_tx_work_queue(): fix tx_skb race condition
[linux-2.6-microblaze.git] / drivers / ptp / ptp_clock.c
index acabbe7..03a246e 100644 (file)
@@ -146,6 +146,15 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct __kernel_timex *tx)
                else
                        err = ops->adjfreq(ops, ppb);
                ptp->dialed_frequency = tx->freq;
+       } else if (tx->modes & ADJ_OFFSET) {
+               if (ops->adjphase) {
+                       s32 offset = tx->offset;
+
+                       if (!(tx->modes & ADJ_NANO))
+                               offset *= NSEC_PER_USEC;
+
+                       err = ops->adjphase(ops, offset);
+               }
        } else if (tx->modes == 0) {
                tx->freq = ptp->dialed_frequency;
                err = 0;