tools: install a fake empty ldconfig script to prevent the system ldconfig from messi...
[openwrt.git] / target / linux / ramips / patches-3.10 / 0001-MTD-m25p80-allow-loading-mtd-name-from-OF.patch
1 From d11f6e47eb748f27ba325bd843cc88bae3ad0e8a 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/25] 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 --- a/drivers/mtd/devices/m25p80.c
16 +++ b/drivers/mtd/devices/m25p80.c
17 @@ -927,10 +927,13 @@ static int m25p_probe(struct spi_device
18         unsigned                        i;
19         struct mtd_part_parser_data     ppdata;
20         struct device_node __maybe_unused *np = spi->dev.of_node;
21 +       const char __maybe_unused       *of_mtd_name = NULL;
22  
23  #ifdef CONFIG_MTD_OF_PARTS
24         if (!of_device_is_available(np))
25                 return -ENODEV;
26 +       of_property_read_string(spi->dev.of_node,
27 +                                       "linux,mtd-name", &of_mtd_name);
28  #endif
29  
30         /* Platform data helps sort out which chip type we have, as
31 @@ -1006,6 +1009,8 @@ static int m25p_probe(struct spi_device
32  
33         if (data && data->name)
34                 flash->mtd.name = data->name;
35 +       else if (of_mtd_name)
36 +               flash->mtd.name = of_mtd_name;
37         else
38                 flash->mtd.name = dev_name(&spi->dev);
39