On Tue, Nov 13, 2018 at 04:40:10PM -0600, Kumar Gala wrote: > If the SPI bus controller is being used for 'spi-slave' mode some of the > checks we have need to change: > > In 'spi-slave' mode #address-cells should be 0, as any children don't > have a reg property. > > Signed-off-by: Kumar Gala <kumar.gala@xxxxxxxxxx> Applied, thanks. > --- > checks.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/checks.c b/checks.c > index 1c398d5..ed84e03 100644 > --- a/checks.c > +++ b/checks.c > @@ -1036,6 +1036,7 @@ static const struct bus_type spi_bus = { > > static void check_spi_bus_bridge(struct check *c, struct dt_info *dti, struct node *node) > { > + int spi_addr_cells = 1; > > if (strprefixeq(node->name, node->basenamelen, "spi")) { > node->bus = &spi_bus; > @@ -1064,7 +1065,9 @@ static void check_spi_bus_bridge(struct check *c, struct dt_info *dti, struct no > if (node->bus != &spi_bus || !node->children) > return; > > - if (node_addr_cells(node) != 1) > + 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"); > @@ -1083,6 +1086,9 @@ static void check_spi_bus_reg(struct check *c, struct dt_info *dti, struct node > if (!node->parent || (node->parent->bus != &spi_bus)) > return; > > + if (get_property(node->parent, "spi-slave")) > + return; > + > prop = get_property(node, "reg"); > if (prop) > cells = (cell_t *)prop->val.val; -- 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:
signature.asc
Description: PGP signature