summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/time_32.c
diff options
context:
space:
mode:
authorMagnus Damm2009-04-28 10:19:50 +0200
committerPaul Mundt2009-04-28 11:01:25 +0200
commit8e0b842948156e3463879caed12b4ce51bed772e (patch)
tree0c5e01d3103e886a89e5663ac02552e04472f8d3 /arch/sh/kernel/time_32.c
parentclocksource: improve sh_cmt clocksource overflow handling (diff)
downloadkernel-qcow2-linux-8e0b842948156e3463879caed12b4ce51bed772e.tar.gz
kernel-qcow2-linux-8e0b842948156e3463879caed12b4ce51bed772e.tar.xz
kernel-qcow2-linux-8e0b842948156e3463879caed12b4ce51bed772e.zip
sh: setup timers in late_time_init()
This patch moves the SuperH timer setup code from time_init() to late_time_init(). Good things about this change: - interrupts: they are enabled at late_time_init() - mm: regular kmalloc() can be used at late_time_init() Together with moving to late_time_init() this patch changes the sh_cmt driver to always allocate with kmalloc(). This simplifies the code a bit and also fixes section mismatches. Signed-off-by: Magnus Damm <damm@igel.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/time_32.c')
-rw-r--r--arch/sh/kernel/time_32.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/arch/sh/kernel/time_32.c b/arch/sh/kernel/time_32.c
index 109409f5ca53..a2458bfdda26 100644
--- a/arch/sh/kernel/time_32.c
+++ b/arch/sh/kernel/time_32.c
@@ -237,21 +237,8 @@ unsigned long long sched_clock(void)
}
#endif
-void __init time_init(void)
+static void __init sh_late_time_init(void)
{
- if (board_time_init)
- board_time_init();
-
- clk_init();
-
- rtc_sh_get_time(&xtime);
- set_normalized_timespec(&wall_to_monotonic,
- -xtime.tv_sec, -xtime.tv_nsec);
-
-#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
- local_timer_setup(smp_processor_id());
-#endif
-
/*
* Make sure all compiled-in early timers register themselves.
* Run probe() for one "earlytimer" device.
@@ -270,3 +257,22 @@ void __init time_init(void)
printk(KERN_INFO "Using %s for system timer\n", sys_timer->name);
}
+
+void __init time_init(void)
+{
+ if (board_time_init)
+ board_time_init();
+
+ clk_init();
+
+ rtc_sh_get_time(&xtime);
+ set_normalized_timespec(&wall_to_monotonic,
+ -xtime.tv_sec, -xtime.tv_nsec);
+
+#ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
+ local_timer_setup(smp_processor_id());
+#endif
+
+ late_time_init = sh_late_time_init;
+}
+