[PATCH 1/6] cfi_flash: fix missing resource update when probing the cfi size

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Mar 30 00:47:51 EDT 2012


introduce in commit 8262d20dae583a
"cfi: convert to struct resource"

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 drivers/nor/cfi_flash.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/nor/cfi_flash.c b/drivers/nor/cfi_flash.c
index 654e647..267c95b 100644
--- a/drivers/nor/cfi_flash.c
+++ b/drivers/nor/cfi_flash.c
@@ -989,6 +989,11 @@ static int cfi_probe (struct device_d *dev)
 	info->base = dev_request_mem_region(dev, 0);
 	info->size = flash_get_size(info);
 
+	if (dev->resource[0].size == 0) {
+		printf("cfi_probe: size : 0x%08lx\n", info->size);
+		dev->resource[0].size = info->size;
+	}
+
 	if (info->flash_id == FLASH_UNKNOWN) {
 		printf ("## Unknown FLASH on Bank at 0x%08x - Size = 0x%08lx = %ld MB\n",
 			dev->resource[0].start, info->size, info->size << 20);
-- 
1.7.9.1




More information about the barebox mailing list