linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: linux-kernel@vger.kernel.org
Cc: John Stultz <johnstul@us.ibm.com>,
	Chris Zankel <chris@zankel.net>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 4/6] clocksource: xtensa: convert to clocksource_register_hz/khz
Date: Wed,  1 Jun 2011 00:32:48 -0700	[thread overview]
Message-ID: <1306913570-9445-5-git-send-email-john.stultz@linaro.org> (raw)
In-Reply-To: <1306913570-9445-1-git-send-email-john.stultz@linaro.org>

From: John Stultz <johnstul@us.ibm.com>

This converts the xtensa clocksource to use clocksource_register_hz/khz

This is untested, so any assistance in testing would be appreciated!

CC: Chris Zankel <chris@zankel.net>
CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
---
 arch/xtensa/kernel/time.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/arch/xtensa/kernel/time.c b/arch/xtensa/kernel/time.c
index f3e5eb4..ac62f9c 100644
--- a/arch/xtensa/kernel/time.c
+++ b/arch/xtensa/kernel/time.c
@@ -41,14 +41,6 @@ static struct clocksource ccount_clocksource = {
 	.rating = 200,
 	.read = ccount_read,
 	.mask = CLOCKSOURCE_MASK(32),
-	/*
-	 * With a shift of 22 the lower limit of the cpu clock is
-	 * 1MHz, where NSEC_PER_CCOUNT is 1000 or a bit less than
-	 * 2^10: Since we have 32 bits and the multiplicator can
-	 * already take up as much as 10 bits, this leaves us with
-	 * remaining upper 22 bits.
-	 */
-	.shift = 22,
 };
 
 static irqreturn_t timer_interrupt(int irq, void *dev_id);
@@ -66,10 +58,7 @@ void __init time_init(void)
 	printk("%d.%02d MHz\n", (int)ccount_per_jiffy/(1000000/HZ),
 			(int)(ccount_per_jiffy/(10000/HZ))%100);
 #endif
-	ccount_clocksource.mult =
-		clocksource_hz2mult(CCOUNT_PER_JIFFY * HZ,
-				ccount_clocksource.shift);
-	clocksource_register(&ccount_clocksource);
+	clocksource_register_hz(&ccount_clocksource, CCOUNT_PER_JIFFY * HZ);
 
 	/* Initialize the linux timer interrupt. */
 
-- 
1.7.3.2.146.gca209


  parent reply	other threads:[~2011-06-01  7:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01  7:32 [PATCH 0/6] clocksource_register_hz/khz cleanups John Stultz
2011-06-01  7:32 ` [PATCH 1/6] clocksource: Convert tcb_clksrc to use clocksource_register_hz/khz John Stultz
2011-06-01  7:32 ` [PATCH 2/6] clocksource: parisc: convert to clocksource_register_hz/khz John Stultz
2011-06-01  7:32 ` [PATCH 3/6] clocksource: um: " John Stultz
2011-06-01  7:32 ` John Stultz [this message]
2011-06-01  7:32 ` [PATCH 5/6] clocksource: cris: convert to clocksource_register_khz John Stultz
2011-06-01  7:32 ` [PATCH 6/6] clocksource: tile: convert to use clocksource_register_hz John Stultz
2011-06-01 16:18   ` Chris Metcalf
2011-06-01 17:55     ` john stultz
2011-06-03 21:27   ` Chris Metcalf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306913570-9445-5-git-send-email-john.stultz@linaro.org \
    --to=john.stultz@linaro.org \
    --cc=chris@zankel.net \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).