[PATCH -next 3/3] arm: Delete similar code across of_flat_dt_match_machine and setup_machine_fdt
From: Xu Qiang
Date: Tue Jul 26 2022 - 23:13:23 EST
of_flat_dt_match_machine() print compatible content when its
return value is NULL, and setup_machine_fdt print again when
mdesc is NULL. So remove duplicate print codes in setup_machine_fdt.
Signed-off-by: Xu Qiang <xuqiang36@xxxxxxxxxx>
---
arch/arm/kernel/devtree.c | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index 182a59b23b09..b6151bcf31cb 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -208,25 +208,8 @@ const struct machine_desc * __init setup_machine_fdt(void *dt_virt)
mdesc = of_flat_dt_match_machine(mdesc_best, arch_get_next_mach);
- if (!mdesc) {
- const char *prop;
- int size;
- unsigned long dt_root;
-
- early_print("\nError: unrecognized/unsupported "
- "device tree compatible list:\n[ ");
-
- dt_root = of_get_flat_dt_root();
- prop = of_get_flat_dt_prop(dt_root, "compatible", &size);
- while (size > 0) {
- early_print("'%s' ", prop);
- size -= strlen(prop) + 1;
- prop += strlen(prop) + 1;
- }
- early_print("]\n\n");
-
+ if (!mdesc)
dump_machine_table(); /* does not return */
- }
/* We really don't want to do this, but sometimes firmware provides buggy data */
if (mdesc->dt_fixup)
--
2.17.1