mtd: nand: pxa3xx: Remove hardcoded mtd name
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Fri Aug 30 16:59:03 EDT 2013
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=f455578dd961087a5cf94730d9f6489bb1d355f0
Commit: f455578dd961087a5cf94730d9f6489bb1d355f0
Parent: b7655bcb40883de6fd218395a55d0cc9089e55a1
Author: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
AuthorDate: Mon Aug 12 14:14:53 2013 -0300
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Aug 30 21:34:56 2013 +0100
mtd: nand: pxa3xx: Remove hardcoded mtd name
There's no advantage in using a hardcoded name for the mtd device.
Instead use the provided by the platform_device.
Signed-off-by: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
Tested-by: Daniel Mack <zonque at gmail.com>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
drivers/mtd/nand/pxa3xx_nand.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index 9f5d8db..8757491 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -244,8 +244,6 @@ static struct pxa3xx_nand_flash builtin_flash_types[] = {
/* Define a default flash type setting serve as flash detecting only */
#define DEFAULT_FLASH_TYPE (&builtin_flash_types[0])
-const char *mtd_names[] = {"pxa3xx_nand-0", "pxa3xx_nand-1", NULL};
-
#define NDTR0_tCH(c) (min((c), 7) << 19)
#define NDTR0_tCS(c) (min((c), 7) << 16)
#define NDTR0_tWH(c) (min((c), 7) << 11)
@@ -1091,8 +1089,6 @@ KEEP_CONFIG:
host->row_addr_cycles = 3;
else
host->row_addr_cycles = 2;
-
- mtd->name = mtd_names[0];
return nand_scan_tail(mtd);
}
@@ -1321,6 +1317,8 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
probe_success = 0;
for (cs = 0; cs < pdata->num_cs; cs++) {
struct mtd_info *mtd = info->host[cs]->mtd;
+
+ mtd->name = pdev->name;
info->cs = cs;
ret = pxa3xx_nand_scan(mtd);
if (ret) {
More information about the linux-mtd-cvs
mailing list