summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-03-28 00:11:16 +0100
committerWolfgang Denk <wd@denx.de>2010-03-28 00:11:16 +0100
commit4284f36a3e7d534b533ce733e088f226c3eda733 (patch)
tree090b739a0e31adf327bab66c1ac2f25b7e6de197
parentc550afada5fcad426aa6a219a329feb9eedae8b2 (diff)
parentc40c94a3d20a8616264c2dfcda85279185d69aeb (diff)
downloadu-boot-imx-4284f36a3e7d534b533ce733e088f226c3eda733.zip
u-boot-imx-4284f36a3e7d534b533ce733e088f226c3eda733.tar.gz
u-boot-imx-4284f36a3e7d534b533ce733e088f226c3eda733.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-cfi-flash
-rw-r--r--drivers/mtd/cfi_flash.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index fdba297..cd1a86e 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -537,7 +537,10 @@ static int flash_status_check (flash_info_t * info, flash_sect_t sector,
ulong start;
#if CONFIG_SYS_HZ != 1000
- tout *= CONFIG_SYS_HZ/1000;
+ if ((ulong)CONFIG_SYS_HZ > 100000)
+ tout *= (ulong)CONFIG_SYS_HZ / 1000; /* for a big HZ, avoid overflow */
+ else
+ tout = DIV_ROUND_UP(tout * (ulong)CONFIG_SYS_HZ, 1000);
#endif
/* Wait for command completion */