public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sven Schnelle <svens@stackframe.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] AVR32: fix timer_init() function
Date: Tue, 04 Oct 2011 19:53:36 -0000	[thread overview]
Message-ID: <1443988412-13421-1-git-send-email-svens@stackframe.org> (raw)

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>
---
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(-)

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;
 }
--
1.7.5.4

             reply	other threads:[~2011-10-04 19:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 19:53 Sven Schnelle [this message]
2011-10-05  7:12 ` [U-Boot] [PATCH v3] AVR32: fix timer_init() function Andreas Bießmann
2011-11-08  9:38   ` [U-Boot] [OT] " Albert ARIBAUD
2011-11-08 10:10     ` Andreas Bießmann
2011-12-13 20:45 ` [U-Boot] " Anatolij Gustschin
2011-12-20 22:11 ` Wolfgang Denk
2012-02-26 22:40 ` Wolfgang Denk
2012-02-27 12:38   ` Sven Schnelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443988412-13421-1-git-send-email-svens@stackframe.org \
    --to=svens@stackframe.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox