All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [U-BOOT][PATCH 2/3] mflash : Remove deprecated CONFIG_SYS_HZ value (not 1000), support code
@ 2009-02-17  7:10 unsik Kim
  0 siblings, 0 replies; only message in thread
From: unsik Kim @ 2009-02-17  7:10 UTC (permalink / raw)
  To: u-boot

Signed-off-by: unsik Kim <donari75@gmail.com>
---
  drivers/block/mg_disk.c |   21 +++------------------
  1 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
index 9ae8889..2eb461d 100644
--- a/drivers/block/mg_disk.c
+++ b/drivers/block/mg_disk.c
@@ -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;
-- 
1.5.6.6

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-17  7:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-17  7:10 [U-Boot] [U-BOOT][PATCH 2/3] mflash : Remove deprecated CONFIG_SYS_HZ value (not 1000), support code unsik Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.