Skip to contentSkip to conversation

mflash : Remove deprecated CONFIG_SYS_HZ value (not 1000), support code

PATCH New unsik Kim 1 participant 1 message Feb 17, 2009 Block layer

lore
Share & tools
lore

unsik Kim

author
#0 lore raw

PATCH 2/3 mflash : Remove deprecated CONFIG_SYS_HZ value (not 1000), support code

---
  drivers/block/mg_disk.c |   21 +++------------------
  1 files changed, 3 insertions(+), 18 deletions(-)
drivers/block/mg_disk.c +3 -18
index 9ae8889..2eb461d 100644
@@ -82,20 +82,6 @@ static void mg_dump_status (const char *msg, unsigned int stat, unsigned err)
  	}
  }
 
-#if CONFIG_SYS_HZ == 1000
-#define msecs_to_hz(s) (s)
-#else
-static unsigned int msecs_to_hz (u32 msec)
-{
-	u32 hz = CONFIG_SYS_HZ / 1000 * msec;
-
-	if (!hz)
-		hz = 1;
-
-	return hz;
-}
-#endif
-
  /*
   * copy src to dest, skipping leading and trailing blanks and null
   * terminate the string
@@ -130,12 +116,11 @@ OUT:
  static unsigned int mg_wait (u32 expect, u32 msec)
  {
  	u8 status;
-	u32 from, cur, expire, err;
+	u32 from, cur, err;
 
  	err = MG_ERR_NONE;
  	reset_timer();
  	from = get_timer(0);
-	expire = msecs_to_hz(msec);
 
  	status = readb(MG_BASE + MG_REG_STATUS);
  	do {
@@ -160,9 +145,9 @@ static unsigned int mg_wait (u32 expect, u32 msec)
  					break;
  		}
  		status = readb(MG_BASE + MG_REG_STATUS);
-	} while (cur < expire);
+	} while (cur < msec);
 
-	if (cur >= expire)
+	if (cur >= msec)
  		err = MG_ERR_TIMEOUT;
 
  	return err;
Signature · 1 line
1.5.6.6