diff mbox series

[02/13] scripts: dtc: checks: don't warn on SPI non-peripheral child nodes

Message ID 20240109-axi-spi-engine-series-3-v1-2-e42c6a986580@baylibre.com (mailing list archive)
State Changes Requested
Headers show
Series spi: axi-spi-engine: add offload support | expand

Commit Message

David Lechner Jan. 10, 2024, 7:49 p.m. UTC
According to the spi-controller.yaml bindings, SPI peripheral child
nodes match the pattern "^.*@[0-9a-f]+$".

A SPI controller binding may require a child object node that is not a
peripheral. For example, the adi,axi-spi-engine binding requires an
"offloads" child node that is not a peripheral but rather a part of the
controller itself.

By checking for '@' in the node name, we can avoids a warnings like:

    Warning (spi_bus_reg): /example-0/spi@44a00000/offloads: missing or empty reg property

for a binding like:

    spi {
        ...

        offloads {
            offload@0 {
                ...
            };
            ...
        };

        peripheral@0 {
            ...
        };
    };

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 scripts/dtc/checks.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Rob Herring Jan. 11, 2024, 10:03 p.m. UTC | #1
On Wed, Jan 10, 2024 at 1:51 PM David Lechner <dlechner@baylibre.com> wrote:
>
> According to the spi-controller.yaml bindings, SPI peripheral child
> nodes match the pattern "^.*@[0-9a-f]+$".
>
> A SPI controller binding may require a child object node that is not a
> peripheral. For example, the adi,axi-spi-engine binding requires an
> "offloads" child node that is not a peripheral but rather a part of the
> controller itself.
>
> By checking for '@' in the node name, we can avoids a warnings like:
>
>     Warning (spi_bus_reg): /example-0/spi@44a00000/offloads: missing or empty reg property
>
> for a binding like:
>
>     spi {
>         ...
>
>         offloads {
>             offload@0 {
>                 ...
>             };
>             ...
>         };
>
>         peripheral@0 {
>             ...
>         };
>     };
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>
> ---
>  scripts/dtc/checks.c | 4 ++++
>  1 file changed, 4 insertions(+)

Check the commit history. We don't take changes to kernel's dtc copy.
They must go upstream first.

Rob
diff mbox series

Patch

diff --git a/scripts/dtc/checks.c b/scripts/dtc/checks.c
index 9f31d2607182..5af68642f231 100644
--- a/scripts/dtc/checks.c
+++ b/scripts/dtc/checks.c
@@ -1144,6 +1144,10 @@  static void check_spi_bus_reg(struct check *c, struct dt_info *dti, struct node
 	if (!node->parent || (node->parent->bus != &spi_bus))
 		return;
 
+	/* only nodes with '@' in name are SPI devices */
+	if (!strchr(unitname, '@'))
+		return;
+
 	if (get_property(node->parent, "spi-slave"))
 		return;