Skip to content

Commit

Permalink
ARM: mxc: update clock source registration
Browse files Browse the repository at this point in the history
In d7e81c2 (clocksource: Add clocksource_register_hz/khz interface) new
interfaces were added which simplify (and optimize) the selection of the
divisor shift/mult constants.  Switch over to using this new interface.

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Dec 22, 2010
1 parent d28b116 commit 509e1f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions arch/arm/plat-mxc/epit.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,14 @@ static struct clocksource clocksource_epit = {
.rating = 200,
.read = epit_read,
.mask = CLOCKSOURCE_MASK(32),
.shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};

static int __init epit_clocksource_init(struct clk *timer_clk)
{
unsigned int c = clk_get_rate(timer_clk);

clocksource_epit.mult = clocksource_hz2mult(c,
clocksource_epit.shift);
clocksource_register(&clocksource_epit);
clocksource_register_hz(&clocksource_epit, c);

return 0;
}
Expand Down
5 changes: 1 addition & 4 deletions arch/arm/plat-mxc/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ static struct clocksource clocksource_mxc = {
.rating = 200,
.read = mx1_2_get_cycles,
.mask = CLOCKSOURCE_MASK(32),
.shift = 20,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};

Expand All @@ -131,9 +130,7 @@ static int __init mxc_clocksource_init(struct clk *timer_clk)
if (timer_is_v2())
clocksource_mxc.read = v2_get_cycles;

clocksource_mxc.mult = clocksource_hz2mult(c,
clocksource_mxc.shift);
clocksource_register(&clocksource_mxc);
clocksource_register_hz(&clocksource_mxc, c);

return 0;
}
Expand Down

0 comments on commit 509e1f0

Please sign in to comment.