4fa957e70b9e374c7581d86d422d433c5e2a3d5e
[openwrt/openwrt.git] / target / linux / ar71xx / patches-4.9 / 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 @@ -192,6 +192,7 @@ static ssize_t m25p80_read(struct spi_no
4 */
5 static int m25p_probe(struct spi_device *spi)
6 {
7 + struct mtd_part_parser_data ppdata = {0,};
8 struct flash_platform_data *data;
9 struct m25p *flash;
10 struct spi_nor *nor;
11 @@ -244,8 +245,11 @@ static int m25p_probe(struct spi_device
12 if (ret)
13 return ret;
14
15 - return mtd_device_register(&nor->mtd, data ? data->parts : NULL,
16 - data ? data->nr_parts : 0);
17 + return mtd_device_parse_register(&nor->mtd,
18 + data ? data->part_probes : NULL,
19 + &ppdata,
20 + data ? data->parts : NULL,
21 + data ? data->nr_parts : 0);
22 }
23
24
25 --- a/include/linux/spi/flash.h
26 +++ b/include/linux/spi/flash.h
27 @@ -24,6 +24,7 @@ struct flash_platform_data {
28 unsigned int nr_parts;
29
30 char *type;
31 + const char **part_probes;
32
33 /* we'll likely add more ... use JEDEC IDs, etc */
34 };