mtd: nand: add option to quieten off the no device found messgae

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Nov 30 05:59:02 EST 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=b1c6e6db5bb7acad82e1c64914c6a9404dae3ee1
Commit:     b1c6e6db5bb7acad82e1c64914c6a9404dae3ee1
Parent:     6eb4feffb9d619a44fe434e777ef095a29cf4759
Author:     Ben Dooks <ben at simtec.co.uk>
AuthorDate: Mon Nov 2 18:12:33 2009 +0000
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Nov 30 09:48:31 2009 +0000

    mtd: nand: add option to quieten off the no device found messgae
    
    Add NAND_SCAN_SILENT_NODEV to chip->options to the user-worrying messages
    'No NAND device found!!!'. This message often worries users (was three
    exclamation marks really necessary?) and especially in systems such as the
    Simtec Osiris where there may be optional NAND devices which are not
    known until probe time.
    
    Revised version of the original NAND_PROBE_SPECULATIVE patch after comments
    by Artem Bityutskiy about adding a whole new call.
    
    Signed-off-by: Ben Dooks <ben at simtec.co.uk>
    Signed-off-by: Simtec Linux Team <linux at simtec.co.uk>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/nand_base.c |    3 ++-
 include/linux/mtd/nand.h     |    4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ba06473..724cb2c 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2756,7 +2756,8 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips)
 	type = nand_get_flash_type(mtd, chip, busw, &nand_maf_id);
 
 	if (IS_ERR(type)) {
-		printk(KERN_WARNING "No NAND device found!!!\n");
+		if (!(chip->options & NAND_SCAN_SILENT_NODEV))
+			printk(KERN_WARNING "No NAND device found.\n");
 		chip->select_chip(mtd, -1);
 		return PTR_ERR(type);
 	}
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 2476078..ccab9df 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -170,7 +170,6 @@ typedef enum {
 /* Chip does not allow subpage writes */
 #define NAND_NO_SUBPAGE_WRITE	0x00000200
 
-
 /* Options valid for Samsung large page devices */
 #define NAND_SAMSUNG_LP_OPTIONS \
 	(NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK)
@@ -196,6 +195,9 @@ typedef enum {
 /* This option is defined if the board driver allocates its own buffers
    (e.g. because it needs them DMA-coherent */
 #define NAND_OWN_BUFFERS	0x00040000
+/* Chip may not exist, so silence any errors in scan */
+#define NAND_SCAN_SILENT_NODEV	0x00080000
+
 /* Options set by nand scan */
 /* Nand scan has allocated controller struct */
 #define NAND_CONTROLLER_ALLOC	0x80000000



More information about the linux-mtd-cvs mailing list