48f8d36da4105e1c94bab61fcefba4d13cb20873
[openwrt/staging/luka.git] / target / linux / generic / patches-3.14 / 049-mtd-bcm47xxpart-find-NVRAM-partitions-in-middle-bloc.patch
1 --- a/drivers/mtd/bcm47xxpart.c
2 +++ b/drivers/mtd/bcm47xxpart.c
3 @@ -199,6 +199,16 @@ static int bcm47xxpart_parse(struct mtd_
4 continue;
5 }
6
7 + /* New (ARM?) devices may have NVRAM in some middle block. Last
8 + * block will be checked later, so skip it.
9 + */
10 + if (offset != master->size - blocksize &&
11 + buf[0x000 / 4] == NVRAM_HEADER) {
12 + bcm47xxpart_add_part(&parts[curr_part++], "nvram",
13 + offset, 0);
14 + continue;
15 + }
16 +
17 /* Read middle of the block */
18 if (mtd_read(master, offset + 0x8000, 0x4,
19 &bytes_read, (uint8_t *)buf) < 0) {