Thread (8 messages) 8 messages, 2 authors, 2023-12-07

Re: [PATCH v1 1/4] of: Add of_machine_compatible_match()

From: Rob Herring <robh@kernel.org>
Date: 2023-12-07 20:16:13
Also in: linuxppc-dev, lkml

On Wed, 06 Dec 2023 17:13:32 +0100, Christophe Leroy wrote:
From: Michael Ellerman <mpe@ellerman.id.au>

We have of_machine_is_compatible() to check if a machine is compatible
with a single compatible string. However some code is able to support
multiple compatible boards, and so wants to check for one of many
compatible strings.

So add of_machine_compatible_match() which takes a NULL terminated
array of compatible strings to check against the root node's
compatible property.

Compared to an open coded match this is slightly more self
documenting, and also avoids the caller needing to juggle the root
node either directly or via of_find_node_by_path().

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Christophe Leroy <redacted>
---
 drivers/of/base.c  | 21 +++++++++++++++++++++
 include/linux/of.h |  6 ++++++
 2 files changed, 27 insertions(+)
Reviewed-by: Rob Herring <robh@kernel.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help