Commit 8aabdf37 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Boris Brezillon

mtd: nand: denali: allow to override mtd->name from label DT property

Commit 28309572 ("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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Suggested-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent 07604686
...@@ -1462,8 +1462,10 @@ int denali_init(struct denali_nand_info *denali) ...@@ -1462,8 +1462,10 @@ int denali_init(struct denali_nand_info *denali)
/* now that our ISR is registered, we can enable interrupts */ /* now that our ISR is registered, we can enable interrupts */
denali_set_intr_modes(denali, true); denali_set_intr_modes(denali, true);
mtd->name = "denali-nand";
nand_set_flash_node(chip, denali->dev->of_node); nand_set_flash_node(chip, denali->dev->of_node);
/* Fallback to the default name if DT did not give "label" property */
if (!mtd->name)
mtd->name = "denali-nand";
/* register the driver with the NAND core subsystem */ /* register the driver with the NAND core subsystem */
chip->select_chip = denali_select_chip; chip->select_chip = denali_select_chip;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment