aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2005-10-25 16:28:43 -0400
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-11-06 17:19:17 -0500
commit6f6ed056d2d5de7af9f0c14cf5bc73707eeb0a88 (patch)
treee6063cb490c6b80226a040bf12da573ea72c87d8 /drivers/mtd
parent008531f4c30dce606094be8f78c766218edd6754 (diff)
[MTD] chips/cfi_cmdset_0001: fix for P30 cfi parsing
Change to the extended cfi table parsing for Intel NOR flash that uses the info in the extended table to 'walk' the table rather than using hard coding for various primary extended query table version numbers. From: Jared Hulbert <jaredeh@gmail.com> Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0001.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index adaad7c8fd46..61a2ec9901e2 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * (C) 2000 Red Hat. GPL'd 5 * (C) 2000 Red Hat. GPL'd
6 * 6 *
7 * $Id: cfi_cmdset_0001.c,v 1.183 2005/08/06 04:46:56 nico Exp $ 7 * $Id: cfi_cmdset_0001.c,v 1.184 2005/10/25 20:28:40 nico Exp $
8 * 8 *
9 * 9 *
10 * 10/10/2000 Nicolas Pitre <nico@cam.org> 10 * 10/10/2000 Nicolas Pitre <nico@cam.org>
@@ -285,7 +285,10 @@ read_pri_intelext(struct map_info *map, __u16 adr)
285 sizeof(struct cfi_intelext_otpinfo); 285 sizeof(struct cfi_intelext_otpinfo);
286 286
287 /* Burst Read info */ 287 /* Burst Read info */
288 extra_size += (extp->MinorVersion < '4') ? 6 : 5; 288 extra_size += 2;
289 if (extp_size < sizeof(*extp) + extra_size)
290 goto need_more;
291 extra_size += extp->extra[extra_size-1];
289 292
290 /* Number of hardware-partitions */ 293 /* Number of hardware-partitions */
291 extra_size += 1; 294 extra_size += 1;
@@ -519,7 +522,7 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd,
519 sizeof(struct cfi_intelext_otpinfo); 522 sizeof(struct cfi_intelext_otpinfo);
520 523
521 /* Burst Read info */ 524 /* Burst Read info */
522 offs += (extp->MinorVersion < '4') ? 6 : 5; 525 offs += extp->extra[offs+1]+2;
523 526
524 /* Number of partition regions */ 527 /* Number of partition regions */
525 numregions = extp->extra[offs]; 528 numregions = extp->extra[offs];