Remove calls to set_timer outside arch/
There is no need to use set_timer(). Replace with appropriate use of
get_timer()
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
Acked-by: Wolfgang Denk <wd@denx.de>
diff --git a/board/idmr/flash.c b/board/idmr/flash.c
index 57c9948..9f4ff2b 100644
--- a/board/idmr/flash.c
+++ b/board/idmr/flash.c
@@ -130,6 +130,7 @@
int iflag, prot, sect;
int rc = ERR_OK;
int chip1;
+ ulong start;
/* first look for protection bits */
@@ -170,7 +171,7 @@
printf ("Erasing sector %2d ... ", sect);
/* arm simple, non interrupt dependent timer */
- set_timer (0);
+ start = get_timer(0);
if (info->protect[sect] == 0) { /* not protected */
volatile u16 *addr =
@@ -191,7 +192,7 @@
result = *addr;
/* check timeout */
- if (get_timer (0) > CONFIG_SYS_FLASH_ERASE_TOUT * CONFIG_SYS_HZ / 1000) {
+ if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT * CONFIG_SYS_HZ / 1000) {
MEM_FLASH_ADDR1 = CMD_READ_ARRAY;
chip1 = TMO;
break;
@@ -248,6 +249,7 @@
int rc = ERR_OK;
int iflag;
int chip1;
+ ulong start;
/*
* Check if Flash is (sufficiently) erased
@@ -272,7 +274,7 @@
*addr = data;
/* arm simple, non interrupt dependent timer */
- set_timer (0);
+ start = get_timer(0);
/* wait until flash is ready */
chip1 = 0;
@@ -280,7 +282,7 @@
result = *addr;
/* check timeout */
- if (get_timer (0) > CONFIG_SYS_FLASH_ERASE_TOUT * CONFIG_SYS_HZ / 1000) {
+ if (get_timer(start) > CONFIG_SYS_FLASH_ERASE_TOUT * CONFIG_SYS_HZ / 1000) {
chip1 = ERR | TMO;
break;
}