mvebu: backport mainline patches from kernel 3.12
[openwrt.git] / target / linux / mvebu / patches-3.10 / 0120-mtd-nand-pxa3xx-Remove-hardcoded-mtd-name.patch
1 From 96d8ffc47c7ee9689b8b48ac9588e0b00fa9bd44 Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Mon, 12 Aug 2013 14:14:53 -0300
4 Subject: [PATCH 120/203] mtd: nand: pxa3xx: Remove hardcoded mtd name
5
6 There's no advantage in using a hardcoded name for the mtd device.
7 Instead use the provided by the platform_device.
8
9 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
10 Tested-by: Daniel Mack <zonque@gmail.com>
11 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
12 Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
13 ---
14  drivers/mtd/nand/pxa3xx_nand.c | 6 ++----
15  1 file changed, 2 insertions(+), 4 deletions(-)
16
17 --- a/drivers/mtd/nand/pxa3xx_nand.c
18 +++ b/drivers/mtd/nand/pxa3xx_nand.c
19 @@ -244,8 +244,6 @@ static struct pxa3xx_nand_flash builtin_
20  /* Define a default flash type setting serve as flash detecting only */
21  #define DEFAULT_FLASH_TYPE (&builtin_flash_types[0])
22  
23 -const char *mtd_names[] = {"pxa3xx_nand-0", "pxa3xx_nand-1", NULL};
24 -
25  #define NDTR0_tCH(c)   (min((c), 7) << 19)
26  #define NDTR0_tCS(c)   (min((c), 7) << 16)
27  #define NDTR0_tWH(c)   (min((c), 7) << 11)
28 @@ -1091,8 +1089,6 @@ KEEP_CONFIG:
29                 host->row_addr_cycles = 3;
30         else
31                 host->row_addr_cycles = 2;
32 -
33 -       mtd->name = mtd_names[0];
34         return nand_scan_tail(mtd);
35  }
36  
37 @@ -1321,6 +1317,8 @@ static int pxa3xx_nand_probe(struct plat
38         probe_success = 0;
39         for (cs = 0; cs < pdata->num_cs; cs++) {
40                 struct mtd_info *mtd = info->host[cs]->mtd;
41 +
42 +               mtd->name = pdev->name;
43                 info->cs = cs;
44                 ret = pxa3xx_nand_scan(mtd);
45                 if (ret) {