From 6efc8df9703c75e2816e7f1299860178cde37e08 Mon Sep 17 00:00:00 2001 From: Fedor Date: Mon, 21 Sep 2009 19:55:13 -0400 Subject: [PATCH] Fix MTD partitions layout --- release/src/linux/linux/arch/mips/bcm947xx/setup.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/release/src/linux/linux/arch/mips/bcm947xx/setup.c b/release/src/linux/linux/arch/mips/bcm947xx/setup.c index 016eb88a3e..d3a755c1ba 100644 --- a/release/src/linux/linux/arch/mips/bcm947xx/setup.c +++ b/release/src/linux/linux/arch/mips/bcm947xx/setup.c @@ -281,16 +281,16 @@ static struct mtd_partition bcm947xx_parts[] = { { name: "pmon", offset: 0, size: 0, mask_flags: MTD_WRITEABLE, }, { name: "linux", offset: 0, size: 0, }, { name: "rootfs", offset: 0, size: 0, mask_flags: MTD_WRITEABLE, }, - { name: "nvram", offset: 0, size: 0, }, { name: "jffs2", offset: 0, size: 0, }, + { name: "nvram", offset: 0, size: 0, }, { name: NULL, }, }; #define PART_BOOT 0 #define PART_LINUX 1 #define PART_ROOTFS 2 -#define PART_NVRAM 3 -#define PART_JFFS2 4 +#define PART_JFFS2 3 +#define PART_NVRAM 4 struct mtd_partition * __init init_mtd_partitions(struct mtd_info *mtd, size_t size) @@ -417,8 +417,12 @@ init_mtd_partitions(struct mtd_info *mtd, size_t size) } } bcm947xx_parts[PART_JFFS2].offset = bcm947xx_parts[PART_NVRAM].offset - bcm947xx_parts[PART_JFFS2].size; - if (bcm947xx_parts[PART_JFFS2].size == 0) { + if (bcm947xx_parts[PART_JFFS2].size <= 0) { bcm947xx_parts[PART_JFFS2].name = NULL; + bcm947xx_parts[PART_JFFS2].size = 0; + } + else { + bcm947xx_parts[PART_ROOTFS].size = bcm947xx_parts[PART_JFFS2].offset - bcm947xx_parts[PART_ROOTFS].offset; } return bcm947xx_parts; -- 2.11.4.GIT