m68knommu: modify timer init code to make it consistent with m68k code
With a few small changes we can make the m68knommu timer init code the
same as the m68k code. By using the mach_sched_init function pointer
and reworking the current timer initializers to keep track of the common
m68k timer_interrupt() handler we end up with almost identical code for
m68knommu.
This will allow us to more easily merge the mmu and non-mmu m68k time.c
in future patches.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
diff --git a/arch/m68k/kernel/setup_no.c b/arch/m68k/kernel/setup_no.c
index 8394b56..7dc186b 100644
--- a/arch/m68k/kernel/setup_no.c
+++ b/arch/m68k/kernel/setup_no.c
@@ -48,6 +48,7 @@
char __initdata command_line[COMMAND_LINE_SIZE];
/* machine dependent timer functions */
+void (*mach_sched_init)(irq_handler_t handler) __initdata = NULL;
int (*mach_set_clock_mmss)(unsigned long);
int (*mach_hwclk) (int, struct rtc_time*);
diff --git a/arch/m68k/kernel/time_no.c b/arch/m68k/kernel/time_no.c
index ca3b3b4..5fa42f1 100644
--- a/arch/m68k/kernel/time_no.c
+++ b/arch/m68k/kernel/time_no.c
@@ -32,12 +32,11 @@
return -1;
}
-#ifndef CONFIG_GENERIC_CLOCKEVENTS
/*
* timer_interrupt() needs to keep up the real-time clock,
* as well as call the "xtime_update()" routine every clocktick
*/
-irqreturn_t arch_timer_interrupt(int irq, void *dummy)
+static irqreturn_t timer_interrupt(int irq, void *dummy)
{
if (current->pid)
@@ -49,7 +48,6 @@
return(IRQ_HANDLED);
}
-#endif
void read_persistent_clock(struct timespec *ts)
{
@@ -72,7 +70,7 @@
return set_rtc_mmss(now.tv_sec);
}
-void time_init(void)
+void __init time_init(void)
{
- hw_timer_init();
+ mach_sched_init(timer_interrupt);
}