diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2020-07-17 10:46:19 +0900 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-07-20 11:37:47 -0600 |
commit | 6ec7545b99d62a5d931473e853aea30f8b9b2aa3 (patch) | |
tree | 7ff5f8429e581ed3e4c853106139a6d82a97a19c /common/fdt_support.c | |
parent | 245ad6c4adb4af5290f22acaba57ed0dd109e1f4 (diff) | |
download | u-boot-6ec7545b99d62a5d931473e853aea30f8b9b2aa3.tar.gz |
fdt_support: skip MTD node with "disabled" in fdt_fixup_mtdparts()
Currently, fdt_fixup_mtdparts() only checks the compatible property.
It is pointless to fix up the disabled node.
Skip the node if it has the property:
status = "disabled"
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/fdt_support.c')
-rw-r--r-- | common/fdt_support.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c index 9c84702b19..a565b470f8 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -955,9 +955,16 @@ void fdt_fixup_mtdparts(void *blob, const struct node_info *node_info, for (i = 0; i < node_info_size; i++) { idx = 0; - noff = fdt_node_offset_by_compatible(blob, -1, - node_info[i].compat); - while (noff != -FDT_ERR_NOTFOUND) { + noff = -1; + + while ((noff = fdt_node_offset_by_compatible(blob, noff, + node_info[i].compat)) >= 0) { + const char *prop; + + prop = fdt_getprop(blob, noff, "status", NULL); + if (prop && !strcmp(prop, "disabled")) + continue; + debug("%s: %s, mtd dev type %d\n", fdt_get_name(blob, noff, 0), node_info[i].compat, node_info[i].type); @@ -973,10 +980,6 @@ void fdt_fixup_mtdparts(void *blob, const struct node_info *node_info, if (fdt_node_set_part_info(blob, noff, dev)) return; /* return on error */ } - - /* Jump to next flash node */ - noff = fdt_node_offset_by_compatible(blob, noff, - node_info[i].compat); } } } |