[U-Boot] [PATCH 6/9] spi: spi_flash: Correct flash size calculation

Siva Durga Prasad Paladugu siva.durga.paladugu at xilinx.com
Mon Jun 6 11:44:51 CEST 2016


Dont need to double the size while calculating
the flash size as the sector size calculation already
takes care of doubling the size incase of dual modes

Signed-off-by: Siva Durga Prasad Paladugu <sivadur at xilinx.com>
---
 drivers/mtd/spi/spi_flash.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 5b22ae2..e4c7ff5 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -1094,7 +1094,7 @@ int spi_flash_scan(struct spi_flash *flash)
 	}
 	flash->page_size <<= flash->shift;
 	flash->sector_size = params->sector_size << flash->shift;
-	flash->size = flash->sector_size * params->nr_sectors << flash->shift;
+	flash->size = flash->sector_size * params->nr_sectors;
 #ifdef CONFIG_SF_DUAL_FLASH
 	if (flash->dual_flash & SF_DUAL_STACKED_FLASH)
 		flash->size <<= 1;
-- 
1.7.1



More information about the U-Boot mailing list