mtd: bcm63xxpart: don't assume NVRAM is always the fourth partition

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Jan 9 13:59:09 EST 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=327c62c554a78af399938445094a7dc834b7fd0b
Commit:     327c62c554a78af399938445094a7dc834b7fd0b
Parent:     678eb9bb8114c47a7b89fd1288ff5dc760c53c1c
Author:     Jonas Gorski <jonas.gorski at gmail.com>
AuthorDate: Sat Dec 17 13:58:16 2011 +0100
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Jan 9 18:20:58 2012 +0000

    mtd: bcm63xxpart: don't assume NVRAM is always the fourth partition
    
    Instead of referencing the sizes of fixed partitions, use the
    precomputed CFE/NVRAM lengths.
    
    Signed-off-by: Jonas Gorski <jonas.gorski at gmail.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/bcm63xxpart.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/bcm63xxpart.c b/drivers/mtd/bcm63xxpart.c
index 17e1370..6afc4aa 100644
--- a/drivers/mtd/bcm63xxpart.c
+++ b/drivers/mtd/bcm63xxpart.c
@@ -165,8 +165,8 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,
 	/* Global partition "linux" to make easy firmware upgrade */
 	curpart++;
 	parts[curpart].name = "linux";
-	parts[curpart].offset = parts[0].size;
-	parts[curpart].size = master->size - parts[0].size - parts[3].size;
+	parts[curpart].offset = cfelen;
+	parts[curpart].size = master->size - cfelen - nvramlen;
 
 	for (i = 0; i < nrparts; i++)
 		pr_info("Partition %d is %s offset %lx and length %lx\n", i,



More information about the linux-mtd-cvs mailing list