public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: unsik Kim <donari75@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-BOOT][PATCH 2/3] mflash : Remove deprecated CONFIG_SYS_HZ value (not 1000), support code
Date: Tue, 17 Feb 2009 16:10:24 +0900	[thread overview]
Message-ID: <499A62E0.2080708@gmail.com> (raw)

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

                 reply	other threads:[~2009-02-17  7:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=499A62E0.2080708@gmail.com \
    --to=donari75@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox