5da93a4dcd9acf86a3c6cb9b16f091433ec0db9b
[openwrt/openwrt.git] / target / linux / ar71xx / patches-3.10 / 407-mtd-m25p80-allow-to-pass-probe-types-via-platform-data.patch
1 --- a/drivers/mtd/devices/m25p80.c
2 +++ b/drivers/mtd/devices/m25p80.c
3 @@ -1121,7 +1121,9 @@ static int m25p_probe(struct spi_device
4 /* partitions should match sector boundaries; and it may be good to
5 * use readonly partitions for writeprotected sectors (BP2..BP0).
6 */
7 - return mtd_device_parse_register(&flash->mtd, NULL, &ppdata,
8 + return mtd_device_parse_register(&flash->mtd,
9 + data ? data->part_probes : NULL,
10 + &ppdata,
11 data ? data->parts : NULL,
12 data ? data->nr_parts : 0);
13 }
14 --- a/include/linux/spi/flash.h
15 +++ b/include/linux/spi/flash.h
16 @@ -24,6 +24,7 @@ struct flash_platform_data {
17 unsigned int nr_parts;
18
19 char *type;
20 + const char **part_probes;
21
22 size_t max_read_len;
23 /* we'll likely add more ... use JEDEC IDs, etc */