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
8 commit f455578dd961087a5cf94730d9f6489bb1d355f0
9 Author: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
10 Date: Mon Aug 12 14:14:53 2013 -0300
12 mtd: nand: pxa3xx: Remove hardcoded mtd name
14 There's no advantage in using a hardcoded name for the mtd device.
15 Instead use the provided by the platform_device.
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.
21 Therefore, to avoid regressions in users relying in 'mtdparts' we revert
22 the change and use the previous one 'pxa3xx_nand-0'.
24 While at it, let's put a big comment and prevent this change from happening
27 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
28 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
30 drivers/mtd/nand/pxa3xx_nand.c | 7 ++++++-
31 1 file changed, 6 insertions(+), 1 deletion(-)
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;
39 - mtd->name = pdev->name;
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.
45 + mtd->name = "pxa3xx_nand-0";
47 ret = pxa3xx_nand_scan(mtd);