summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-03-29 12:33:43 +0200
committerWolfgang Denk <wd@denx.de>2010-03-29 12:33:43 +0200
commit0020db3f0da61f3e2c8a459a87598e07594dc8ac (patch)
tree2fe0852444f2412149130186bc740914f4ba794f /drivers
parent0d41ad7edcd23b6f23a1cf4e07b2d773493306fd (diff)
parent2883cc2d48e99fd1873ef8af03fee7966611b735 (diff)
downloadblackbird-obmc-uboot-0020db3f0da61f3e2c8a459a87598e07594dc8ac.tar.gz
blackbird-obmc-uboot-0020db3f0da61f3e2c8a459a87598e07594dc8ac.zip
Merge remote branch 'origin/master' into next
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 15a4220d4f..d0240f55d4 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 */
OpenPOWER on IntegriCloud