[PATCH 05/27] amd-xgbe: Use timecounter_initialize interface
From: Sagar Arun Kamble
Date: Fri Dec 15 2017 - 02:44:01 EST
With new interface timecounter_initialize we can initialize timecounter
fields and underlying cyclecounter together. Update xgbe tstamp_tc
timecounter init with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@xxxxxxxxx>
Cc: Richard Cochran <richardcochran@xxxxxxxxx>
Cc: Tom Lendacky <thomas.lendacky@xxxxxxx>
Cc: netdev@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
drivers/net/ethernet/amd/xgbe/xgbe-ptp.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c b/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c
index 5ea4edf..486437b 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-ptp.c
@@ -228,7 +228,6 @@ void xgbe_ptp_register(struct xgbe_prv_data *pdata)
{
struct ptp_clock_info *info = &pdata->ptp_clock_info;
struct ptp_clock *clock;
- struct cyclecounter *cc = &pdata->tstamp_tc.cc;
u64 dividend;
snprintf(info->name, sizeof(info->name), "%s",
@@ -258,12 +257,12 @@ void xgbe_ptp_register(struct xgbe_prv_data *pdata)
pdata->tstamp_addend = div_u64(dividend, pdata->ptpclk_rate);
/* Setup the timecounter */
- cc->read = xgbe_cc_read;
- cc->mask = CLOCKSOURCE_MASK(64);
- cc->mult = 1;
- cc->shift = 0;
-
- timecounter_init(&pdata->tstamp_tc, ktime_to_ns(ktime_get_real()));
+ timecounter_initialize(&pdata->tstamp_tc,
+ xgbe_cc_read,
+ CLOCKSOURCE_MASK(64),
+ 1,
+ 0,
+ ktime_to_ns(ktime_get_real()));
/* Disable all timestamping to start */
XGMAC_IOWRITE(pdata, MAC_TSCR, 0);
--
1.9.1