From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Kumar Gala <kumar.gala-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH 2/2] checks: Relax SPI slave checks
Date: Fri, 2 Oct 2020 13:34:40 +1000 [thread overview]
Message-ID: <20201002033440.GL1844@yekko.fritz.box> (raw)
In-Reply-To: <20200928201942.3242124-2-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1964 bytes --]
On Mon, Sep 28, 2020 at 03:19:42PM -0500, Rob Herring wrote:
> SPI slaves only have a single child node and therefore don't need
> '#address-cells' nor '#size-cells', so let's skip the check for those when
> 'spi-slave' is present.
I really don't like this idea. Yes, you can work out what's going on
unambiguously because there's only one child, but that requires at
least some familiarity with SPI. I think general consistency trumps
minimality here, and we should encourage SPI nodes to have the correct
-cells properties, even if they're not strictly essential.
>
> Cc: Kumar Gala <kumar.gala-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> ---
> checks.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/checks.c b/checks.c
> index 17cb6890d45a..c923295c6e40 100644
> --- a/checks.c
> +++ b/checks.c
> @@ -1102,13 +1102,12 @@ static void check_spi_bus_bridge(struct check *c, struct dt_info *dti, struct no
> if (node->bus != &spi_bus || !node->children)
> return;
>
> - if (get_property(node, "spi-slave"))
> - spi_addr_cells = 0;
> - if (node_addr_cells(node) != spi_addr_cells)
> - FAIL(c, dti, node, "incorrect #address-cells for SPI bus");
> - if (node_size_cells(node) != 0)
> - FAIL(c, dti, node, "incorrect #size-cells for SPI bus");
> -
> + if (!get_property(node, "spi-slave")) {
> + if (node_addr_cells(node) != spi_addr_cells)
> + FAIL(c, dti, node, "incorrect #address-cells for SPI bus");
> + if (node_size_cells(node) != 0)
> + FAIL(c, dti, node, "incorrect #size-cells for SPI bus");
> + }
> }
> WARNING(spi_bus_bridge, check_spi_bus_bridge, NULL, &addr_size_cells);
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-10-02 3:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-28 20:19 [PATCH 1/2] checks: Allow PCI bridge child nodes without an address Rob Herring
[not found] ` <20200928201942.3242124-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2020-09-28 20:19 ` [PATCH 2/2] checks: Relax SPI slave checks Rob Herring
[not found] ` <20200928201942.3242124-2-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2020-10-02 3:34 ` David Gibson [this message]
2020-10-02 3:30 ` [PATCH 1/2] checks: Allow PCI bridge child nodes without an address David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201002033440.GL1844@yekko.fritz.box \
--to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
--cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=kumar.gala-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).