diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-03-30 02:45:48 -0400 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2017-04-25 08:18:31 -0400 |
commit | 8aabdf376f2baafbaaceeee1f3f7f7dca70f8e0b (patch) | |
tree | ad5ca31bf76eb0b6ea784c843148b9a0e34c4d0a /drivers/mtd | |
parent | 07604686e808cd93d352172806a7828860f048f5 (diff) |
mtd: nand: denali: allow to override mtd->name from label DT property
Commit 28309572aac4 ("mtd: name the mtd device with an optional
label property") allow us to identify a chip in a user-friendly way.
If nand_set_flash_node() picks up the "label" from DT, let's respect
it. Otherwise, let it fallback to the current name "denali-nand".
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Suggested-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/denali.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index 4ca75d3926ef..4e6d03d7a031 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c | |||
@@ -1462,8 +1462,10 @@ int denali_init(struct denali_nand_info *denali) | |||
1462 | 1462 | ||
1463 | /* now that our ISR is registered, we can enable interrupts */ | 1463 | /* now that our ISR is registered, we can enable interrupts */ |
1464 | denali_set_intr_modes(denali, true); | 1464 | denali_set_intr_modes(denali, true); |
1465 | mtd->name = "denali-nand"; | ||
1466 | nand_set_flash_node(chip, denali->dev->of_node); | 1465 | nand_set_flash_node(chip, denali->dev->of_node); |
1466 | /* Fallback to the default name if DT did not give "label" property */ | ||
1467 | if (!mtd->name) | ||
1468 | mtd->name = "denali-nand"; | ||
1467 | 1469 | ||
1468 | /* register the driver with the NAND core subsystem */ | 1470 | /* register the driver with the NAND core subsystem */ |
1469 | chip->select_chip = denali_select_chip; | 1471 | chip->select_chip = denali_select_chip; |