Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753916AbdLOHfd (ORCPT ); Fri, 15 Dec 2017 02:35:33 -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 S1753368AbdLOHfU (ORCPT ); Fri, 15 Dec 2017 02:35:20 -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="158949207" From: Sagar Arun Kamble To: linux-kernel@vger.kernel.org Cc: Sagar Arun Kamble , Richard Cochran , Michal Simek , Daniel Lezcano , Neil Armstrong , Nicolai Stange , Arnd Bergmann , Rob Herring , Thomas Gleixner Subject: [PATCH 03/27] microblaze: Use timecounter_initialize interface Date: Fri, 15 Dec 2017 13:08:18 +0530 Message-Id: <1513323522-15021-4-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: 1654 Lines: 55 With new interface timecounter_initialize we can initialize timecounter fields and underlying cyclecounter together. Update xilinx_tc init with this new function. Signed-off-by: Sagar Arun Kamble Cc: Richard Cochran Cc: Michal Simek Cc: Daniel Lezcano Cc: Neil Armstrong Cc: Nicolai Stange Cc: Arnd Bergmann Cc: Rob Herring Cc: Thomas Gleixner Cc: linux-kernel@vger.kernel.org --- arch/microblaze/kernel/timer.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c index b7f89e9..b32a896 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c @@ -204,20 +204,21 @@ static u64 xilinx_cc_read(const struct cyclecounter *cc) return xilinx_read(NULL); } -static struct timecounter xilinx_tc = { - .cc.read = xilinx_cc_read, - .cc.mask = CLOCKSOURCE_MASK(32), - .cc.mult = 0, - .cc.shift = 8, -}; +static struct timecounter xilinx_tc; static int __init init_xilinx_timecounter(void) { - struct cyclecounter *cc = &xilinx_tc.cc; + u32 mult = 0; + u32 shift = 8; - cc->mult = div_sc(timer_clock_freq, NSEC_PER_SEC, cc->shift); + mult = div_sc(timer_clock_freq, NSEC_PER_SEC, shift); - timecounter_init(&xilinx_tc, sched_clock()); + timecounter_initialize(&xilinx_tc, + xilinx_cc_read, + CLOCKSOURCE_MASK(32), + mult, + shift, + sched_clock()); return 0; } -- 1.9.1