Skip to contentSkip to conversation

coldfire: Change timer_init return type from void to int

PATCH Superseded stany MARCEL 4 participants 4 messages Aug 30, 2011 – Sep 2, 2011 m68k architecture

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 coldfire: Change timer_init return type from void to int

timer_init protorype change for uniformization with other architectures

---
 arch/m68k/cpu/mcf547x_8x/slicetimer.c |    4 +++-
 arch/m68k/lib/board.c                 |    2 +-
 arch/m68k/lib/time.c                  |    8 ++++++--
 3 files changed, 10 insertions(+), 4 deletions(-)
arch/m68k/cpu/mcf547x_8x/slicetimer.c +3 -1
index 467a807..ee96aad 100644
@@ -72,7 +72,7 @@ void dtimer_interrupt(void *not_used)
 	}
 }
 
-void timer_init(void)
+int timer_init(void)
 {
 	volatile slt_t *timerp = (slt_t *) (CONFIG_SYS_TMR_BASE);
 
@@ -93,6 +93,8 @@ void timer_init(void)
 	/* set a period of 1us, set timer mode to restart and
 	   enable timer and interrupt */
 	timerp->cr = SLT_CR_RUN | SLT_CR_IEN | SLT_CR_TEN;
+
+	return 0;
 }
 
 ulong get_timer(ulong base)
arch/m68k/lib/board.c +1 -1
index 945ab66..694289e 100644
@@ -78,7 +78,7 @@ static char *failed = "*** failed ***\n";
 extern ulong __init_end;
 extern ulong __bss_end__;
 
-extern	void timer_init(void);
+extern int timer_init(void);
 
 #if defined(CONFIG_WATCHDOG)
 # define INIT_FUNC_WATCHDOG_INIT	watchdog_init,
arch/m68k/lib/time.c +6 -2
index a316cdf..a1eb983 100644
@@ -91,7 +91,7 @@ void dtimer_interrupt(void *not_used)
 	}
 }
 
-void timer_init(void)
+int timer_init(void)
 {
 	volatile dtmr_t *timerp = (dtmr_t *) (CONFIG_SYS_TMR_BASE);
 
@@ -114,6 +114,8 @@ void timer_init(void)
 	/* set a period of 1us, set timer mode to restart and enable timer and interrupt */
 	timerp->tmr = CONFIG_SYS_TIMER_PRESCALER | DTIM_DTMR_CLK_DIV1 |
 	    DTIM_DTMR_FRR | DTIM_DTMR_ORRI | DTIM_DTMR_RST_EN;
+
+	return 0;
 }
 
 ulong get_timer(ulong base)
@@ -153,7 +155,7 @@ void __udelay(unsigned long usec)
 	}
 }
 
-void timer_init(void)
+int timer_init(void)
 {
 	volatile pit_t *timerp = (pit_t *) (CONFIG_SYS_PIT_BASE);
 	timestamp = 0;
@@ -162,6 +164,8 @@ void timer_init(void)
 	timerp->pcsr = PIT_PCSR_OVW;
 	timerp->pmr = lastinc = 0;
 	timerp->pcsr |= PIT_PCSR_PRE(CONFIG_SYS_PIT_PRESCALE) | PIT_PCSR_EN;
+
+	return 0;
 }
 
 ulong get_timer(ulong base)
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/5 coldfire: Change timer_init return type from void to int

arch/m68k/cpu/mcf547x_8x/slicetimer.c void dtimer_interrupt(void *not_used) · line 75

Quoted 5 lines · On Tuesday, August 30, 2011 09:00:10 stany MARCEL wrote:
arch/m68k/cpu/mcf547x_8x/slicetimer.c +1 -1
 
-void timer_init(void)
+int timer_init(void)

you should have gotten a build error as the prototype is in common.h. so please add an include for common.h to this file.

arch/m68k/lib/board.c static char *failed = "*** failed ***\n"; · line 81

Quoted 5 lines
arch/m68k/lib/board.c +1 -1
 
-extern	void timer_init(void);
+extern int timer_init(void);

drop the extern and include common.h

arch/m68k/lib/time.c

Quoted 5 lines
arch/m68k/lib/time.c +1 -1
 
-void timer_init(void)
+int timer_init(void)

include common.h in this file too
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110830/ee8de740/attachment.pgp

#2 lore raw

PATCH 1/5 coldfire: Change timer_init return type from void to int

Dear Mike Frysinger,

Quoted 1 line · In message <[email protected]> you wrote:

...

Quoted 2 lines

you should have gotten a build error as the prototype is in common.h. so=20 please add an include for common.h to this file.

...

Quoted 1 line

drop the extern and include common.h

...

When requesting changes to a patch, can you (and everybody else!)

*** P L E A S E ***

update the patch state in Patchworks to "Changes requested" ?

Thanks!

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The only person who always got his work done by Friday
                                                 was Robinson Crusoe.
#3 lore raw

PATCH v2 1/5 coldfire: Change timer_init return type from void to int

In reply to stany MARCEL

From: Stany MARCEL <[email protected]>

timer_init protorype change for uniformization with other architectures

---
Changes for v2:
- Remove extern of timer_init

 arch/m68k/cpu/mcf547x_8x/slicetimer.c |    4 +++-
 arch/m68k/lib/board.c                 |    2 --
 arch/m68k/lib/time.c                  |    8 ++++++--
 3 files changed, 9 insertions(+), 5 deletions(-)
arch/m68k/cpu/mcf547x_8x/slicetimer.c +3 -1
index 467a807..ee96aad 100644
@@ -72,7 +72,7 @@ void dtimer_interrupt(void *not_used)
 	}
 }
 
-void timer_init(void)
+int timer_init(void)
 {
 	volatile slt_t *timerp = (slt_t *) (CONFIG_SYS_TMR_BASE);
 
@@ -93,6 +93,8 @@ void timer_init(void)
 	/* set a period of 1us, set timer mode to restart and
 	   enable timer and interrupt */
 	timerp->cr = SLT_CR_RUN | SLT_CR_IEN | SLT_CR_TEN;
+
+	return 0;
 }
 
 ulong get_timer(ulong base)
arch/m68k/lib/board.c +0 -2
index 945ab66..1df50f1 100644
@@ -78,8 +78,6 @@ static char *failed = "*** failed ***\n";
 extern ulong __init_end;
 extern ulong __bss_end__;
 
-extern	void timer_init(void);
-
 #if defined(CONFIG_WATCHDOG)
 # define INIT_FUNC_WATCHDOG_INIT	watchdog_init,
 # define WATCHDOG_DISABLE		watchdog_disable
arch/m68k/lib/time.c +6 -2
index a316cdf..a1eb983 100644
@@ -91,7 +91,7 @@ void dtimer_interrupt(void *not_used)
 	}
 }
 
-void timer_init(void)
+int timer_init(void)
 {
 	volatile dtmr_t *timerp = (dtmr_t *) (CONFIG_SYS_TMR_BASE);
 
@@ -114,6 +114,8 @@ void timer_init(void)
 	/* set a period of 1us, set timer mode to restart and enable timer and interrupt */
 	timerp->tmr = CONFIG_SYS_TIMER_PRESCALER | DTIM_DTMR_CLK_DIV1 |
 	    DTIM_DTMR_FRR | DTIM_DTMR_ORRI | DTIM_DTMR_RST_EN;
+
+	return 0;
 }
 
 ulong get_timer(ulong base)
@@ -153,7 +155,7 @@ void __udelay(unsigned long usec)
 	}
 }
 
-void timer_init(void)
+int timer_init(void)
 {
 	volatile pit_t *timerp = (pit_t *) (CONFIG_SYS_PIT_BASE);
 	timestamp = 0;
@@ -162,6 +164,8 @@ void timer_init(void)
 	timerp->pcsr = PIT_PCSR_OVW;
 	timerp->pmr = lastinc = 0;
 	timerp->pcsr |= PIT_PCSR_PRE(CONFIG_SYS_PIT_PRESCALE) | PIT_PCSR_EN;
+
+	return 0;
 }
 
 ulong get_timer(ulong base)

--
1.7.1