Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754975AbdLOHn5 (ORCPT ); Fri, 15 Dec 2017 02:43:57 -0500 Received: from mga06.intel.com ([134.134.136.31]:56932 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753633AbdLOHfZ (ORCPT ); Fri, 15 Dec 2017 02:35:25 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,403,1508828400"; d="scan'208";a="158949221" From: Sagar Arun Kamble To: linux-kernel@vger.kernel.org Cc: Sagar Arun Kamble , Richard Cochran , Tom Lendacky , netdev@vger.kernel.org Subject: [PATCH 05/27] amd-xgbe: Use timecounter_initialize interface Date: Fri, 15 Dec 2017 13:08:20 +0530 Message-Id: <1513323522-15021-6-git-send-email-sagar.a.kamble@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com> References: <1513323522-15021-1-git-send-email-sagar.a.kamble@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1603 Lines: 46 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 Cc: Richard Cochran Cc: Tom Lendacky Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- 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