base-files: define yes/no as valid boolean options
[openwrt.git] / target / linux / mvebu / patches-3.10 / 0127-mtd-nand-pxa3xx-Fix-registered-MTD-name.patch
1 From fe013a7a5667763bde164dd5c9341ee5361a9c23 Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Sat, 19 Oct 2013 18:19:25 -0300
4 Subject: [PATCH 127/203] mtd: nand: pxa3xx: Fix registered MTD name
5
6 In a recent commit:
7
8   commit f455578dd961087a5cf94730d9f6489bb1d355f0
9   Author: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
10   Date:   Mon Aug 12 14:14:53 2013 -0300
11
12   mtd: nand: pxa3xx: Remove hardcoded mtd name
13
14   There's no advantage in using a hardcoded name for the mtd device.
15   Instead use the provided by the platform_device.
16
17 The MTD name was changed to use the one provided by the platform_device.
18 However, this can be problematic as some users want to set partitions
19 using the kernel parameter 'mtdparts', where the name is needed.
20
21 Therefore, to avoid regressions in users relying in 'mtdparts' we revert
22 the change and use the previous one 'pxa3xx_nand-0'.
23
24 While at it, let's put a big comment and prevent this change from happening
25 ever again.
26
27 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
28 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
29 ---
30  drivers/mtd/nand/pxa3xx_nand.c | 7 ++++++-
31  1 file changed, 6 insertions(+), 1 deletion(-)
32
33 --- a/drivers/mtd/nand/pxa3xx_nand.c
34 +++ b/drivers/mtd/nand/pxa3xx_nand.c
35 @@ -1320,7 +1320,12 @@ static int pxa3xx_nand_probe(struct plat
36         for (cs = 0; cs < pdata->num_cs; cs++) {
37                 struct mtd_info *mtd = info->host[cs]->mtd;
38  
39 -               mtd->name = pdev->name;
40 +               /*
41 +                * The mtd name matches the one used in 'mtdparts' kernel
42 +                * parameter. This name cannot be changed or otherwise
43 +                * user's mtd partitions configuration would get broken.
44 +                */
45 +               mtd->name = "pxa3xx_nand-0";
46                 info->cs = cs;
47                 ret = pxa3xx_nand_scan(mtd);
48                 if (ret) {