Patch for jedec_probe
Jonas Holmberg
jonas.holmberg at axis.com
Mon Feb 4 05:52:29 EST 2002
I need the jedec_probe to give up when finding a chip of a different
manufacturer or device id (or no chip at all) than a previously found
chip in the same map.
This patch below fixes that. Is it OK to commit?
/Jonas
Index: jedec_probe.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/jedec_probe.c,v
retrieving revision 1.10
diff -u -r1.10 jedec_probe.c
--- jedec_probe.c 2002/01/21 18:09:01 1.10
+++ jedec_probe.c 2002/02/04 10:46:45
@@ -832,6 +832,19 @@
goto retry;
}
return 0;
+ } else {
+ __u16 mfr;
+ __u16 id;
+
+ /* Make sure it is a chip of the same manufacturer and
id */
+ mfr = jedec_read_mfr(map, base, cfi);
+ id = jedec_read_id(map, base, cfi);
+
+ if ((mfr != cfi->mfr) || (id != cfi->id)) {
+ printk(KERN_DEBUG "%s: Found different chip or
no chip at all (mfr %x, id %x) at 0x%x\n",
+ map->name, mfr, id, base);
+ return 0;
+ }
}
/* Check each previous chip to see if it's an alias */
More information about the linux-mtd
mailing list