]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/chips/cfi_cmdset_0020.c
[MTD] CHIPS: Recognize Spansion CFI 1.4 chips
[linux-2.6-omap-h63xx.git] / drivers / mtd / chips / cfi_cmdset_0020.c
index c894f880157831f1d1c3524aa77d9a462d77dd60..d22df2d96788afda357105625dc987e124027597 100644 (file)
@@ -4,7 +4,7 @@
  *
  * (C) 2000 Red Hat. GPL'd
  *
- * $Id: cfi_cmdset_0020.c,v 1.19 2005/07/13 15:52:45 dwmw2 Exp $
+ * $Id: cfi_cmdset_0020.c,v 1.20 2005/07/20 21:01:14 tpoynor Exp $
  * 
  * 10/10/2000  Nicolas Pitre <nico@cam.org>
  *     - completely revamped method functions so they are aware and
@@ -133,6 +133,15 @@ struct mtd_info *cfi_cmdset_0020(struct map_info *map, int primary)
                if (!extp)
                        return NULL;
 
+               if (extp->MajorVersion != '1' ||
+                   (extp->MinorVersion < '0' || extp->MinorVersion > '3')) {
+                       printk(KERN_ERR "  Unknown ST Microelectronics"
+                              " Extended Query version %c.%c.\n",
+                              extp->MajorVersion, extp->MinorVersion);
+                       kfree(extp);
+                       return NULL;
+               }
+
                /* Do some byteswapping if necessary */
                extp->FeatureSupport = cfi32_to_cpu(extp->FeatureSupport);
                extp->BlkStatusRegMask = cfi32_to_cpu(extp->BlkStatusRegMask);