public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] AVR32: fix timer_init() function
@ 2011-10-04  9:20 Sven Schnelle
  2011-10-04 13:39 ` Andreas Bießmann
  0 siblings, 1 reply; 4+ messages in thread
From: Sven Schnelle @ 2011-10-04  9:20 UTC (permalink / raw)
  To: u-boot

timer_init() now returns an int (the error code) instead of void.
This makes compilation fail with:

interrupts.c:111: error: conflicting types for 'timer_init'
/home/svens/u-boot/u-boot/include/common.h:246: error: previous declaration of 'timer_init' was here
make[1]: *** [interrupts.o] Error 1

Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
 arch/avr32/cpu/interrupts.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/avr32/cpu/interrupts.c b/arch/avr32/cpu/interrupts.c
index 6681e13..2aee2cc 100644
--- a/arch/avr32/cpu/interrupts.c
+++ b/arch/avr32/cpu/interrupts.c
@@ -107,10 +107,11 @@ static int set_interrupt_handler(unsigned int nr, void (*handler)(void),
 	return 0;
 }
 
-void timer_init(void)
+int timer_init(void)
 {
 	extern void timer_interrupt_handler(void);
 	u64 tmp;
+	int ret;
 
 	sysreg_write(COUNT, 0);
 
@@ -119,9 +120,10 @@ void timer_init(void)
 	do_div(tmp, gd->cpu_hz);
 	tb_factor = (u32)tmp;
 
-	if (set_interrupt_handler(0, &timer_interrupt_handler, 3))
-		return;
+	if ((ret = set_interrupt_handler(0, &timer_interrupt_handler, 3)))
+		return ret;
 
 	/* For all practical purposes, this gives us an overflow interrupt */
 	sysreg_write(COMPARE, 0xffffffff);
+	return 0;
 }
-- 
1.7.6.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-04 17:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-04  9:20 [U-Boot] [PATCH] AVR32: fix timer_init() function Sven Schnelle
2011-10-04 13:39 ` Andreas Bießmann
2011-10-04 14:37   ` Sven Schnelle
2011-10-04 17:19     ` Andreas Bießmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox