[PATCH 2/2] cfi_flash: size_ratio should not be 0
Sascha Hauer
s.hauer at pengutronix.de
Mon May 27 04:30:20 EDT 2013
On Wed, May 22, 2013 at 09:53:40AM +0200, Oleksij Rempel wrote:
> We will get size = 0 if size_ratio = 0
>
> Signed-off-by: Oleksij Rempel <linux at rempel-privat.de>
Applied, thanks
Sascha
> ---
> drivers/mtd/nor/cfi_flash.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nor/cfi_flash.c b/drivers/mtd/nor/cfi_flash.c
> index 4b4e29d..85e96ce 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",
> --
> 1.8.1.2
>
>
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list