[PATCH 19/27] net: fec: ptp: Use timecounter_reset interface
From: Sagar Arun Kamble
Date: Fri Dec 15 2017 - 02:36:16 EST
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.kamble@xxxxxxxxx>
Cc: Richard Cochran <richardcochran@xxxxxxxxx>
Cc: Fugang Duan <fugang.duan@xxxxxxx>
Cc: netdev@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
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