mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-08-20 17:08:52 +09:00
AVR32: fix timer_init() function
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> Acked-by: Andreas Bießmann <andreas.devel@googlemail.com> Signed-off-by: Anatolij Gustschin <agust@denx.de>
This commit is contained in:
parent
e570fe8ef2
commit
bf0b631343
@ -107,7 +107,7 @@ static int set_interrupt_handler(unsigned int nr, void (*handler)(void),
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void timer_init(void)
|
int timer_init(void)
|
||||||
{
|
{
|
||||||
extern void timer_interrupt_handler(void);
|
extern void timer_interrupt_handler(void);
|
||||||
u64 tmp;
|
u64 tmp;
|
||||||
@ -120,8 +120,9 @@ void timer_init(void)
|
|||||||
tb_factor = (u32)tmp;
|
tb_factor = (u32)tmp;
|
||||||
|
|
||||||
if (set_interrupt_handler(0, &timer_interrupt_handler, 3))
|
if (set_interrupt_handler(0, &timer_interrupt_handler, 3))
|
||||||
return;
|
return -EINVAL;
|
||||||
|
|
||||||
/* For all practical purposes, this gives us an overflow interrupt */
|
/* For all practical purposes, this gives us an overflow interrupt */
|
||||||
sysreg_write(COMPARE, 0xffffffff);
|
sysreg_write(COMPARE, 0xffffffff);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user