From patchwork Sun Oct 4 19:53:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [U-Boot,v3] AVR32: fix timer_init() function Date: Sun, 04 Oct 2015 09:53:32 -0000 From: Sven Schnelle X-Patchwork-Id: 117688 Message-Id: <1443988412-13421-1-git-send-email-svens@stackframe.org> To: u-boot@lists.denx.de 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 Acked-by: Andreas Bießmann --- Changes for v3: - return -EINVAL regardless of the return value Changes for v2: - Coding style arch/avr32/cpu/interrupts.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) -- 1.7.5.4 diff --git a/arch/avr32/cpu/interrupts.c b/arch/avr32/cpu/interrupts.c index 6681e13..49a00f1 100644 --- a/arch/avr32/cpu/interrupts.c +++ b/arch/avr32/cpu/interrupts.c @@ -107,7 +107,7 @@ 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; @@ -120,8 +120,9 @@ void timer_init(void) tb_factor = (u32)tmp; if (set_interrupt_handler(0, &timer_interrupt_handler, 3)) - return; + return -EINVAL; /* For all practical purposes, this gives us an overflow interrupt */ sysreg_write(COMPARE, 0xffffffff); + return 0; }