Title: [8928] trunk: [#5975] make sure id must exist for standard JEDEC flash
Revision
8928
Author
bhsong
Date
2010-06-18 06:08:48 -0400 (Fri, 18 Jun 2010)

Log Message

[#5975] make sure id must exist for standard JEDEC flash

For non-JEDEC, we have no way to make sure whether flash exist or not by detection

Modified Paths

Diff

Modified: trunk/drivers/mtd/devices/m25p80.c (8927 => 8928)


--- trunk/drivers/mtd/devices/m25p80.c	2010-06-18 08:36:09 UTC (rev 8927)
+++ trunk/drivers/mtd/devices/m25p80.c	2010-06-18 10:08:48 UTC (rev 8928)
@@ -795,8 +795,13 @@
 
 		jid = jedec_probe(spi);
 		if (!jid) {
-			dev_info(&spi->dev, "non-JEDEC variant of %s\n",
-				 id->name);
+			if (data->jedec) {
+				dev_err(&spi->dev, "fail to detect%s\n",
+						id->name);
+				return -ENODEV;
+			} else
+				dev_info(&spi->dev, "non-JEDEC variant of %s\n",
+						id->name);
 		} else if (jid != id) {
 			/*
 			 * JEDEC knows better, so overwrite platform ID. We

Modified: trunk/include/linux/spi/flash.h (8927 => 8928)


--- trunk/include/linux/spi/flash.h	2010-06-18 08:36:09 UTC (rev 8927)
+++ trunk/include/linux/spi/flash.h	2010-06-18 10:08:48 UTC (rev 8928)
@@ -25,6 +25,12 @@
 
 	char		*type;
 
+	/*
+	 * 1: standard JEDEC, id need be matched while detecting
+	 * 0: non-JEDEC, id will be 0. in this case, we can't find
+	 * make sure whether the flash exists or not by detecting
+	 */
+	int             jedec;
 	/* we'll likely add more ... use JEDEC IDs, etc */
 };
 
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to