Signed-off-by: unsik Kim <donar...@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
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to