summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWolfgang Denk <[email protected]>2010-03-28 00:15:20 +0100
committerWolfgang Denk <[email protected]>2010-03-28 00:15:20 +0100
commitcc3074c322bd8023cbebe475e4e4e413b1c06da3 (patch)
treedf6040da7d90147f46edf8a82b667b802f549cd9 /drivers
parent04387d24a17b1ee13024dd4779da4b84d47c65cc (diff)
parent4284f36a3e7d534b533ce733e088f226c3eda733 (diff)
Merge branch 'master' of /home/wd/git/u-boot/custodians
Diffstat (limited to 'drivers')
-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 fdba297c88b..cd1a86ebad2 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 */