[lantiq] bump to v3.8
[openwrt/svn-archive/archive.git] / target / linux / lantiq / patches-3.8 / 0001-MTD-m25p80-allow-loading-mtd-name-from-OF.patch
1 From e65ecb8f256b5839690a240d9b14e303686f9ede Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Tue, 29 Jan 2013 21:11:55 +0100
4 Subject: [PATCH 01/40] MTD: m25p80: allow loading mtd name from OF
5
6 In accordance with the physmap flash we should honour the linux,mtd-name
7 property when deciding what name the mtd device has.
8
9 Signed-off-by: Thomas Langer <thomas.langer@lantiq.com>
10 Signed-off-by: John Crispin <blogic@openwrt.org>
11 ---
12 drivers/mtd/devices/m25p80.c | 5 +++++
13 1 file changed, 5 insertions(+)
14
15 diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
16 index 4eeeb2d..b12da33 100644
17 --- a/drivers/mtd/devices/m25p80.c
18 +++ b/drivers/mtd/devices/m25p80.c
19 @@ -810,10 +810,13 @@ static int m25p_probe(struct spi_device *spi)
20 unsigned i;
21 struct mtd_part_parser_data ppdata;
22 struct device_node __maybe_unused *np = spi->dev.of_node;
23 + const char __maybe_unused *of_mtd_name = NULL;
24
25 #ifdef CONFIG_MTD_OF_PARTS
26 if (!of_device_is_available(np))
27 return -ENODEV;
28 + of_property_read_string(spi->dev.of_node,
29 + "linux,mtd-name", &of_mtd_name);
30 #endif
31
32 /* Platform data helps sort out which chip type we have, as
33 @@ -889,6 +892,8 @@ static int m25p_probe(struct spi_device *spi)
34
35 if (data && data->name)
36 flash->mtd.name = data->name;
37 + else if (of_mtd_name)
38 + flash->mtd.name = of_mtd_name;
39 else
40 flash->mtd.name = dev_name(&spi->dev);
41
42 --
43 1.7.10.4
44