Patchwork [V2] mtd nand : print flash size during detection

login
register
mail settings
Submitter Matthieu CASTET
Date Nov. 22, 2012, 5:33 p.m.
Message ID <1353605620-29549-1-git-send-email-matthieu.castet@parrot.com>
Download mbox | patch
Permalink /patch/201098/
State New
Headers show

Comments

Matthieu CASTET - Nov. 22, 2012, 5:33 p.m.
This help to detect bad flash identification in case the size is not present
on the name (ONFI).

Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
---
 drivers/mtd/nand/nand_base.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Artem Bityutskiy - Nov. 30, 2012, 1:20 p.m.
On Thu, 2012-11-22 at 18:33 +0100, Matthieu CASTET wrote:
> This help to detect bad flash identification in case the size is not present
> on the name (ONFI).
> 
> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>

Pushed to l2-mtd.git, thanks!

Patch

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 16e95e7..8eda5db 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3285,10 +3285,10 @@  ident_done:
 		chip->cmdfunc = nand_command_lp;
 
 	pr_info("NAND device: Manufacturer ID: 0x%02x, Chip ID: 0x%02x (%s %s),"
-		" page size: %d, OOB size: %d\n",
+		" %dMiB, page size: %d, OOB size: %d\n",
 		*maf_id, *dev_id, nand_manuf_ids[maf_idx].name,
 		chip->onfi_version ? chip->onfi_params.model : type->name,
-		mtd->writesize, mtd->oobsize);
+		(int)(chip->chipsize >> 20), mtd->writesize, mtd->oobsize);
 
 	return type;
 }