diff options
| author | Samuel Holland <[email protected]> | 2025-03-25 16:43:31 -0700 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2025-04-23 12:32:51 +0530 |
| commit | 1c579675beb551f03ee0fae0c00af5e7a890da71 (patch) | |
| tree | a8121702e0201e5572a23906a990dd1f537d96ac | |
| parent | b80ded7756c233ebe9536b77823c51e916e43ffa (diff) | |
platform: generic: Initialize overrides with fdt_driver
In addition to deduplicating the code, this also improves the match
selection logic to respect the priority order of the compatible strings,
as implemented in commit 0ffe265fd969 ("lib: utils/fdt: Respect
compatible string fallback priority").
Signed-off-by: Samuel Holland <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Anup Patel <[email protected]>
| -rw-r--r-- | platform/generic/platform.c | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/platform/generic/platform.c b/platform/generic/platform.c index 19566e69..04448d71 100644 --- a/platform/generic/platform.c +++ b/platform/generic/platform.c @@ -33,31 +33,6 @@ /* List of platform override modules generated at compile time */ extern const struct fdt_driver *const platform_override_modules[]; -static void fw_platform_lookup_special(const void *fdt, int root_offset) -{ - const struct fdt_driver *plat; - const struct fdt_match *match; - int pos, rc; - - for (pos = 0; platform_override_modules[pos]; pos++) { - plat = platform_override_modules[pos]; - if (!plat->match_table) - continue; - - match = fdt_match_node(fdt, root_offset, plat->match_table); - if (!match) - continue; - - if (plat->init) { - rc = plat->init(fdt, root_offset, match); - if (rc) - continue; - } - - break; - } -} - static u32 fw_platform_calculate_heap_size(u32 hart_count) { u32 heap_size; @@ -177,7 +152,7 @@ unsigned long fw_platform_init(unsigned long arg0, unsigned long arg1, if (root_offset < 0) goto fail; - fw_platform_lookup_special(fdt, root_offset); + fdt_driver_init_by_offset(fdt, root_offset, platform_override_modules); model = fdt_getprop(fdt, root_offset, "model", &len); if (model) |
