]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/net/ethernet/freescale/fec_ptp.c
Merge remote-tracking branch 'ipsec/master'
[karo-tx-linux.git] / drivers / net / ethernet / freescale / fec_ptp.c
index 1543cf0e8ef647c92f1748e474833cf55300a490..f9e74461bdc0b089c64b751571e8a999a050433b 100644 (file)
@@ -112,9 +112,8 @@ static int fec_ptp_enable_pps(struct fec_enet_private *fep, uint enable)
        unsigned long flags;
        u32 val, tempval;
        int inc;
-       struct timespec ts;
+       struct timespec64 ts;
        u64 ns;
-       u32 remainder;
        val = 0;
 
        if (!(fep->hwts_tx_en || fep->hwts_rx_en)) {
@@ -163,8 +162,7 @@ static int fec_ptp_enable_pps(struct fec_enet_private *fep, uint enable)
                tempval = readl(fep->hwp + FEC_ATIME);
                /* Convert the ptp local counter to 1588 timestamp */
                ns = timecounter_cyc2time(&fep->tc, tempval);
-               ts.tv_sec = div_u64_rem(ns, 1000000000ULL, &remainder);
-               ts.tv_nsec = remainder;
+               ts = ns_to_timespec64(ns);
 
                /* The tempval is  less than 3 seconds, and  so val is less than
                 * 4 seconds. No overflow for 32bit calculation.