diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2023-02-18 10:15:45 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-03-14 14:52:10 +0100 |
commit | 2fc39acfcacf3dc1392d8062f6d7b7d94eb2537c (patch) | |
tree | 0f7ac1efaf52ebe3a4e602a06e1ac45511dd9709 /arch/powerpc/kernel/setup-common.c | |
parent | powerpc/machdep: Make machine name const (diff) | |
download | linux-2fc39acfcacf3dc1392d8062f6d7b7d94eb2537c.tar.xz linux-2fc39acfcacf3dc1392d8062f6d7b7d94eb2537c.zip |
powerpc/machdep: Define 'compatible' property in ppc_md and use it
Most probe functions do nothing else than checking whether
the machine is compatible to a given string.
Define that string in ppc_md structure and check it directly from
probe_machine() instead of using ppc_md.probe() for that.
Keep checking in ppc_md.probe() only for more complex probing.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/6cb9865d916231c38401ba34ad1a98c249fae135.1676711562.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/kernel/setup-common.c')
-rw-r--r-- | arch/powerpc/kernel/setup-common.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index e77734e5a127..d2a446216444 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -630,13 +630,14 @@ static __init void probe_machine(void) for (machine_id = &__machine_desc_start; machine_id < &__machine_desc_end; machine_id++) { - DBG(" %s ...", machine_id->name); + DBG(" %s ...\n", machine_id->name); + if (machine_id->compatible && !of_machine_is_compatible(machine_id->compatible)) + continue; memcpy(&ppc_md, machine_id, sizeof(struct machdep_calls)); - if (ppc_md.probe()) { - DBG(" match !\n"); - break; - } - DBG("\n"); + if (ppc_md.probe && !ppc_md.probe()) + continue; + DBG(" %s match !\n", machine_id->name); + break; } /* What can we do if we didn't find ? */ if (machine_id >= &__machine_desc_end) { |