Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754789AbdLOHnS (ORCPT ); Fri, 15 Dec 2017 02:43:18 -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 S1753321AbdLOHf3 (ORCPT ); Fri, 15 Dec 2017 02:35:29 -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="158949254" From: Sagar Arun Kamble To: linux-kernel@vger.kernel.org Cc: Sagar Arun Kamble , Richard Cochran , Fugang Duan , netdev@vger.kernel.org Subject: [PATCH 07/27] fec: Use timecounter_initialize interface Date: Fri, 15 Dec 2017 13:08:22 +0530 Message-Id: <1513323522-15021-8-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: 1443 Lines: 41 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 Cc: Richard Cochran Cc: Fugang Duan Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.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