9
0
Fork 0

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>
This commit is contained in:
Oleksij Rempel 2013-05-22 09:53:40 +02:00 committed by Sascha Hauer
parent fbf9d87633
commit 24b9ea6e75
1 changed files with 2 additions and 1 deletions

View File

@ -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",