diff options
author | Oleksij Rempel <linux@rempel-privat.de> | 2013-05-22 09:53:40 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-05-27 18:24:05 +0200 |
commit | 24b9ea6e751686ff3b031a6f5e1437eaddc7aa46 (patch) | |
tree | 104ced70f5ea8acf67e74b47c665b07b0f9e2be5 /drivers/mtd/nor | |
parent | fbf9d876334ba5ef50704fe33543a48a9e6d0440 (diff) | |
download | barebox-24b9ea6e751686ff3b031a6f5e1437eaddc7aa46.tar.gz barebox-24b9ea6e751686ff3b031a6f5e1437eaddc7aa46.tar.xz |
cfi_flash: size_ratio should not be 0
We will get size = 0 if size_ratio = 0
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mtd/nor')
-rw-r--r-- | drivers/mtd/nor/cfi_flash.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/nor/cfi_flash.c b/drivers/mtd/nor/cfi_flash.c index 4b4e29d4a4..85e96ceed0 100644 --- a/drivers/mtd/nor/cfi_flash.c +++ b/drivers/mtd/nor/cfi_flash.c @@ -371,7 +371,8 @@ static ulong flash_get_size (struct flash_info *info) size_ratio = info->portwidth / info->chipwidth; /* if the chip is x8/x16 reduce the ratio by half */ if ((info->interface == FLASH_CFI_X8X16) - && (info->chipwidth == FLASH_CFI_BY8)) { + && (info->chipwidth == FLASH_CFI_BY8) + && (size_ratio != 1)) { size_ratio >>= 1; } debug ("size_ratio %d port %d bits chip %d bits\n", |