[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1513323522-15021-8-git-send-email-sagar.a.kamble@intel.com>
Date: Fri, 15 Dec 2017 13:08:22 +0530
From: Sagar Arun Kamble <sagar.a.kamble@...el.com>
To: linux-kernel@...r.kernel.org
Cc: Sagar Arun Kamble <sagar.a.kamble@...el.com>,
Richard Cochran <richardcochran@...il.com>,
Fugang Duan <fugang.duan@....com>, netdev@...r.kernel.org
Subject: [PATCH 07/27] fec: Use timecounter_initialize interface
With new interface timecounter_initialize we can initialize timecounter
fields and underlying cyclecounter together. Update fec ethernet
timecounter init with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@...el.com>
Cc: Richard Cochran <richardcochran@...il.com>
Cc: Fugang Duan <fugang.duan@....com>
Cc: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
drivers/net/ethernet/freescale/fec_ptp.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
index b1261d1..1ba7216 100644
--- a/drivers/net/ethernet/freescale/fec_ptp.c
+++ b/drivers/net/ethernet/freescale/fec_ptp.c
@@ -278,14 +278,13 @@ void fec_ptp_start_cyclecounter(struct net_device *ndev)
writel(FEC_T_CTRL_ENABLE | FEC_T_CTRL_PERIOD_RST,
fep->hwp + FEC_ATIME_CTRL);
- memset(&fep->tc.cc, 0, sizeof(fep->tc.cc));
- fep->tc.cc.read = fec_ptp_read;
- fep->tc.cc.mask = CLOCKSOURCE_MASK(31);
- fep->tc.cc.shift = 31;
- fep->tc.cc.mult = FEC_CC_MULT;
-
- /* reset the ns time counter */
- timecounter_init(&fep->tc, ktime_to_ns(ktime_get_real()));
+ /* Initialize the ns time counter */
+ timecounter_initialize(&fep->tc,
+ fec_ptp_read,
+ CLOCKSOURCE_MASK(31),
+ FEC_CC_MULT,
+ 31,
+ ktime_to_ns(ktime_get_real()));
spin_unlock_irqrestore(&fep->tmreg_lock, flags);
}
--
1.9.1
Powered by blists - more mailing lists