Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754988AbdLOHoV (ORCPT ); Fri, 15 Dec 2017 02:44:21 -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 S1753622AbdLOHfX (ORCPT ); Fri, 15 Dec 2017 02:35:23 -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="158949214" From: Sagar Arun Kamble To: linux-kernel@vger.kernel.org Cc: Sagar Arun Kamble , Richard Cochran , Mark Rutland , Marc Zyngier , Daniel Lezcano , Thomas Gleixner , linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/27] clocksource/arm_arch_timer: Use timecounter_initialize interface Date: Fri, 15 Dec 2017 13:08:19 +0530 Message-Id: <1513323522-15021-5-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: 2257 Lines: 58 With new interface timecounter_initialize we can initialize timecounter fields and underlying cyclecounter together. Update arch_timer_kvm_info timecounter init with this new function. Signed-off-by: Sagar Arun Kamble Cc: Richard Cochran Cc: Mark Rutland Cc: Marc Zyngier Cc: Daniel Lezcano Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/clocksource/arm_arch_timer.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c index 31543e5..d96393f 100644 --- a/drivers/clocksource/arm_arch_timer.c +++ b/drivers/clocksource/arm_arch_timer.c @@ -910,10 +910,7 @@ static u64 arch_counter_get_cntvct_mem(void) return ((u64) vct_hi << 32) | vct_lo; } -static struct arch_timer_kvm_info arch_timer_kvm_info = { - .timecounter.cc.read = arch_counter_read_cc, - .timecounter.cc.mask = CLOCKSOURCE_MASK(56), -}; +static struct arch_timer_kvm_info arch_timer_kvm_info; struct arch_timer_kvm_info *arch_timer_get_kvm_info(void) { @@ -923,7 +920,6 @@ struct arch_timer_kvm_info *arch_timer_get_kvm_info(void) static void __init arch_counter_register(unsigned type) { u64 start_count; - struct cyclecounter *cc = &arch_timer_kvm_info.timecounter.cc; /* Register the CP15 based counter if we have one */ if (type & ARCH_TIMER_TYPE_CP15) { @@ -943,9 +939,12 @@ static void __init arch_counter_register(unsigned type) start_count = arch_timer_read_counter(); clocksource_register_hz(&clocksource_counter, arch_timer_rate); - cc->mult = clocksource_counter.mult; - cc->shift = clocksource_counter.shift; - timecounter_init(&arch_timer_kvm_info.timecounter, start_count); + timecounter_initialize(&arch_timer_kvm_info.timecounter, + arch_counter_read_cc, + CLOCKSOURCE_MASK(56), + clocksource_counter.mult, + clocksource_counter.shift, + start_count); /* 56 bits minimum, so we assume worst case rollover */ sched_clock_register(arch_timer_read_counter, 56, arch_timer_rate); -- 1.9.1