Skip to content

Commit

Permalink
mtd: nand: pxa3xx: Remove hardcoded mtd name
Browse files Browse the repository at this point in the history
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@free-electrons.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Ezequiel Garcia authored and David Woodhouse committed Aug 30, 2013
1 parent b7655bc commit f455578
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/mtd/nand/pxa3xx_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1091,8 +1089,6 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
host->row_addr_cycles = 3;
else
host->row_addr_cycles = 2;

mtd->name = mtd_names[0];
return nand_scan_tail(mtd);
}

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit f455578

Please sign in to comment.