With new interface timecounter_reset we can update the start time for
timecounter. Update fec_ptp_settime with this new function.

Signed-off-by: Sagar Arun Kamble <sagar.a.kam...@intel.com>
Cc: Richard Cochran <richardcoch...@gmail.com>
Cc: Fugang Duan <fugang.d...@nxp.com>
Cc: net...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 drivers/net/ethernet/freescale/fec_ptp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_ptp.c 
b/drivers/net/ethernet/freescale/fec_ptp.c
index 1ba7216..d03ea0e 100644
--- a/drivers/net/ethernet/freescale/fec_ptp.c
+++ b/drivers/net/ethernet/freescale/fec_ptp.c
@@ -419,7 +419,6 @@ static int fec_ptp_settime(struct ptp_clock_info *ptp,
 {
        struct fec_enet_private *fep =
            container_of(ptp, struct fec_enet_private, ptp_caps);
-
        u64 ns;
        unsigned long flags;
        u32 counter;
@@ -439,7 +438,7 @@ static int fec_ptp_settime(struct ptp_clock_info *ptp,
 
        spin_lock_irqsave(&fep->tmreg_lock, flags);
        writel(counter, fep->hwp + FEC_ATIME);
-       timecounter_init(&fep->tc, ns);
+       timecounter_reset(&fep->tc, ns);
        spin_unlock_irqrestore(&fep->tmreg_lock, flags);
        mutex_unlock(&fep->ptp_clk_mutex);
        return 0;
-- 
1.9.1

Reply via email to