]> git.baikalelectronics.ru Git - uboot.git/commit
fdt_support: call mtdparts_init() after finding MTD node to fix up
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 17 Jul 2020 01:46:18 +0000 (10:46 +0900)
committerSimon Glass <sjg@chromium.org>
Sat, 25 Jul 2020 20:46:57 +0000 (14:46 -0600)
commita782b2150c6a5fb705008aa7c09f5c28aaf27139
tree0b2101e3a10ef1c1510d3717ebe71e309419664c
parentffc03bcb9ed37babb81a301fecdbbafe21d1d714
fdt_support: call mtdparts_init() after finding MTD node to fix up

Platform code can call fdt_fixup_mtdparts() in order to hand U-Boot's
MTD partitions over to the Linux device tree.

Currently, fdt_fixup_mtdparts() calls mtdparts_init() in its entry.
If no target MTD device is found, an error message like follows is
displayed:

    Device nand0 not found!

This occurs when the same code (e.g. arch/arm/mach-uniphier/fdt-fixup.c)
is shared among several boards, but not all of them support an MTD device.

Parse the DT first, then call mtdparts_init() only when the target MTD
node is found.

Yet, you still need to call mtdparts_init() before device_find().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/fdt_support.c