[PATCH RFC 1/4] boot/fit: use constants for property strings
Quentin Schulz
foss+uboot at 0leil.net
Wed Apr 9 17:10:25 CEST 2025
From: Quentin Schulz <quentin.schulz at cherry.de>
Some properties have their string represented in include/image.h via
constants, so let's use those constants instead of using a hardcoded
string.
Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>
---
boot/common_fit.c | 4 ++--
boot/image-fit.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/boot/common_fit.c b/boot/common_fit.c
index a2f9b8d83c3b66a39ae0e172445d162f5146578a..fd434fe28e1908596365c9d31892a73ec97c36e3 100644
--- a/boot/common_fit.c
+++ b/boot/common_fit.c
@@ -46,12 +46,12 @@ int fit_find_config_node(const void *fdt)
return -EINVAL;
}
- dflt_conf_name = fdt_getprop(fdt, conf, "default", &len);
+ dflt_conf_name = fdt_getprop(fdt, conf, FIT_DEFAULT_PROP, &len);
for (node = fdt_first_subnode(fdt, conf);
node >= 0;
node = fdt_next_subnode(fdt, node)) {
- name = fdt_getprop(fdt, node, "description", &len);
+ name = fdt_getprop(fdt, node, FIT_DESC_PROP, &len);
if (!name) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: Missing FDT description in DTB\n",
diff --git a/boot/image-fit.c b/boot/image-fit.c
index 41ab1f552b04d6a5731625ce8c03e17730f8d0cd..7c822a39fd85554a716d9cada54cbaf91b3ec24a 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -1760,7 +1760,7 @@ int fit_conf_find_compat(const void *fit, const void *fdt)
fdt = fit; /* search in FIT image */
compat_noffset = noffset; /* search under config node */
} else { /* Otherwise extract it from the kernel FDT. */
- kfdt_name = fdt_getprop(fit, noffset, "fdt", &len);
+ kfdt_name = fdt_getprop(fit, noffset, FIT_FDT_PROP, &len);
if (!kfdt_name) {
debug("No fdt property found.\n");
continue;
--
2.49.0
More information about the U-Boot
mailing list