[PATCH v1 3/4] powerpc/machdep: Define 'compatibles' property in ppc_md and use it

Rob Herring robh at kernel.org
Fri Dec 8 07:15:16 AEDT 2023


On Wed, Dec 06, 2023 at 05:13:34PM +0100, Christophe Leroy wrote:
> Most probe functions that do not use the 'compatible' string do
> nothing else than checking whether the machine is compatible with
> one of the strings in a NULL terminated table of strings.
> 
> Define that table of strings 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.
> 
> All .compatible could be replaced with a single element NULL
> terminated list but that's not worth the churn. Can be do incrementaly
> in follow-up patches.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy at csgroup.eu>
> ---
>  arch/powerpc/include/asm/machdep.h            |  1 +
>  arch/powerpc/kernel/setup-common.c            |  2 ++
>  arch/powerpc/platforms/40x/ppc40x_simple.c    |  9 +++------
>  arch/powerpc/platforms/512x/mpc512x_generic.c |  4 +---
>  arch/powerpc/platforms/52xx/lite5200.c        | 10 +---------
>  arch/powerpc/platforms/52xx/mpc5200_simple.c  | 10 +---------
>  arch/powerpc/platforms/83xx/mpc830x_rdb.c     | 10 +---------
>  arch/powerpc/platforms/83xx/mpc831x_rdb.c     | 10 +---------
>  arch/powerpc/platforms/83xx/mpc837x_rdb.c     | 10 +---------
>  arch/powerpc/platforms/85xx/corenet_generic.c |  2 +-
>  arch/powerpc/platforms/85xx/tqm85xx.c         | 10 +---------
>  11 files changed, 14 insertions(+), 64 deletions(-)

> -/*
> - * Called very early, MMU is off, device-tree isn't unflattened
> - */

Certainly an out of date comment as the unflattened API was being 
called.

Reviewed-by: Rob Herring <robh at kernel.org>


More information about the Linuxppc-dev mailing list