
From: Simon Glass <sjg@chromium.org> This property is part of the configuration node, so add a constant for it, instead of open-coding the value. This allows easy searching for places in U-Boot where the configuration node's compatible string is used. Signed-off-by: Simon Glass <sjg@chromium.org> --- boot/image-board.c | 3 ++- boot/image-fit.c | 6 +++--- include/image.h | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/boot/image-board.c b/boot/image-board.c index a0d2a7405e1..4b285587cd9 100644 --- a/boot/image-board.c +++ b/boot/image-board.c @@ -676,7 +676,8 @@ int boot_get_fpga(struct bootm_headers *images) } conf_noffset = fit_image_get_node(buf, uname); - compatible = fdt_getprop(buf, conf_noffset, "compatible", NULL); + compatible = fdt_getprop(buf, conf_noffset, FIT_COMPATIBLE_PROP, + NULL); if (!compatible) { printf("'fpga' image without 'compatible' property\n"); } else { diff --git a/boot/image-fit.c b/boot/image-fit.c index d0221c3c64b..dfb26ba716b 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -1717,9 +1717,9 @@ int fit_conf_find_compat(const void *fit, const void *fdt) return -EINVAL; } - fdt_compat = fdt_getprop(fdt, 0, "compatible", &fdt_compat_len); + fdt_compat = fdt_getprop(fdt, 0, FIT_COMPATIBLE_PROP, &fdt_compat_len); if (!fdt_compat) { - debug("Fdt for comparison has no \"compatible\" property.\n"); + debug("Fdt for comparison has no 'compatible' property.\n"); return -ENXIO; } @@ -1742,7 +1742,7 @@ int fit_conf_find_compat(const void *fit, const void *fdt) continue; /* If there's a compat property in the config node, use that. */ - if (fdt_getprop(fit, noffset, "compatible", NULL)) { + if (fdt_getprop(fit, noffset, FIT_COMPATIBLE_PROP, NULL)) { fdt = fit; /* search in FIT image */ compat_noffset = noffset; /* search under config node */ } else { /* Otherwise extract it from the kernel FDT. */ diff --git a/include/image.h b/include/image.h index cff1b8bf4cb..6a4cb912bc4 100644 --- a/include/image.h +++ b/include/image.h @@ -1186,6 +1186,7 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size, #define FIT_STANDALONE_PROP "standalone" #define FIT_SCRIPT_PROP "script" #define FIT_LOAD_ONLY_PROP "load-only" +#define FIT_COMPATIBLE_PROP "compatible" #define FIT_MAX_HASH_LEN HASH_MAX_DIGEST_SIZE -- 2.43.0