Merge tag 'perf-tools-for-v5.14-2021-07-10' of git://git.kernel.org/pub/scm/linux...
[linux-2.6-microblaze.git] / drivers / ptp / ptp_clock.c
index 21c4c34..a23a37a 100644 (file)
@@ -63,27 +63,6 @@ static void enqueue_external_timestamp(struct timestamp_event_queue *queue,
        spin_unlock_irqrestore(&queue->lock, flags);
 }
 
-long scaled_ppm_to_ppb(long ppm)
-{
-       /*
-        * The 'freq' field in the 'struct timex' is in parts per
-        * million, but with a 16 bit binary fractional field.
-        *
-        * We want to calculate
-        *
-        *    ppb = scaled_ppm * 1000 / 2^16
-        *
-        * which simplifies to
-        *
-        *    ppb = scaled_ppm * 125 / 2^13
-        */
-       s64 ppb = 1 + ppm;
-       ppb *= 125;
-       ppb >>= 13;
-       return (long) ppb;
-}
-EXPORT_SYMBOL(scaled_ppm_to_ppb);
-
 /* posix clock implementation */
 
 static int ptp_clock_getres(struct posix_clock *pc, struct timespec64 *tp)
@@ -239,6 +218,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
                        pr_err("failed to create ptp aux_worker %d\n", err);
                        goto kworker_err;
                }
+               ptp->pps_source->lookup_cookie = ptp;
        }
 
        err = ptp_populate_pin_groups(ptp);