summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-04-05 10:44:28 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-04-05 10:58:02 +0200
commit14bc0e9f83839d63a1ccf96de9db6ccb2e6ea177 (patch)
treed82fb84fe8ad0623fdf8c141d962b8e9778d476e /drivers
parentac29648413d1a33126ad1f98714717cbee452e55 (diff)
downloadbarebox-14bc0e9f83839d63a1ccf96de9db6ccb2e6ea177.tar.gz
barebox-14bc0e9f83839d63a1ccf96de9db6ccb2e6ea177.tar.xz
cfi flash: Fix loop count calculation
'reduce the number of loops by the width of the port' means a simple len / width. Do not try to be clever by shifting and doing it wrong. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nor/cfi_flash_intel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nor/cfi_flash_intel.c b/drivers/nor/cfi_flash_intel.c
index 6318cfec83..f0cbf72d88 100644
--- a/drivers/nor/cfi_flash_intel.c
+++ b/drivers/nor/cfi_flash_intel.c
@@ -68,7 +68,7 @@ static int intel_flash_write_cfibuffer (struct flash_info *info, ulong dest, con
return retcode;
/* reduce the number of loops by the width of the port */
- cnt = len >> (info->portwidth - 1);
+ cnt = len / width;
flash_write_cmd(info, sector, 0, (u32)cnt - 1);
while (cnt-- > 0) {