mtd: print out the page size and oob size after parsing out the nand

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon May 14 15:59:02 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=b3f0bba1b6d6f45b8ec9d2c25247ff3002cc3369
Commit:     b3f0bba1b6d6f45b8ec9d2c25247ff3002cc3369
Parent:     4b0f1923114b3dee963ec6f8f7375a2b479a6e13
Author:     Huang Shijie <b32955 at freescale.com>
AuthorDate: Mon Apr 9 11:41:37 2012 +0800
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sun May 13 22:41:16 2012 -0500

    mtd: print out the page size and oob size after parsing out the nand
    
    Some not-supported nand chips may pass the current parsing code,
    and get the wrong page size and oob size. Sometimes, it's hard to notice
    that you get the wrong values, because there is no warning or error.
    
    So it's useful to print out the page size and oob size in the end of
    the parsing function. We can check these values with the datasheet of the nand
    chip as soon as possible.
    
    Artem: amend the print a bit
    
    Signed-off-by: Huang Shijie <b32955 at freescale.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at linux.intel.com>
    (cherry picked from commit fb7f6004f35c4fbb20d054d1f16f898bf94e3349)
---
 drivers/mtd/nand/nand_base.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 47b19c0..eb88d8b 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3154,10 +3154,11 @@ ident_done:
 	if (mtd->writesize > 512 && chip->cmdfunc == nand_command)
 		chip->cmdfunc = nand_command_lp;
 
-	pr_info("NAND device: Manufacturer ID:"
-		" 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id, *dev_id,
-		nand_manuf_ids[maf_idx].name,
-		chip->onfi_version ? chip->onfi_params.model : type->name);
+	pr_info("NAND device: Manufacturer ID: 0x%02x, Chip ID: 0x%02x (%s %s),"
+		" 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);
 
 	return type;
 }



More information about the linux-mtd-cvs mailing list