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@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
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 @@
/* 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,