checks: Allow PCI bridge child nodes without an address
PATCH 1/2 checks: Allow PCI bridge child nodes without an address
Some PCI bridge nodes have child nodes such as an interrupt controller which are not PCI devices. Allow these nodes which don't have a unit-address.
--- checks.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
checks.c +1 -3
@@ -891,10 +891,8 @@ static void check_pci_device_reg(struct check *c, struct dt_info *dti, struct noreturn ; prop =get_property (node,"reg" ); -if (!prop) { -FAIL (c, dti, node,"missing PCI reg property" ); +if (!prop)return ; - } cells = (cell_t *)prop->val.val;if (cells[1 ] || cells[2 ])
Signature · 1 line
2.25.1
A message that is not in the archive (sent off-list or not yet received): 20200928201942.3242124-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
PATCH 2/2 checks: Relax SPI slave checks
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.
--- checks.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
checks.c +6 -7
@@ -1102,13 +1102,12 @@ static void check_spi_bus_bridge(struct check *c, struct dt_info *dti, struct noif (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);
Signature · 1 line
2.25.1
A message that is not in the archive (sent off-list or not yet received): 20200928201942.3242124-2-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Re: [PATCH 2/2] checks: Relax SPI slave checks
Quoted 3 lines · Rob Herring
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.
Quoted 31 lines
Cc Kumar Gala <[email protected]>Signed-off-by Rob Herring <[email protected]>--- checks.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)checks.c +6
-7@@ -1102,13 +1102,12 @@ static void check_spi_bus_bridge(struct check *c, struct dt_info *dti, struct noif (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);
Signature · 4 lines
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
Quoted 5 lines · Rob Herring
Some PCI bridge nodes have child nodes such as an interrupt controller which are not PCI devices. Allow these nodes which don't have a unit-address.
Signed-off-by Rob Herring <[email protected]>
I suspect doing that isn't really IEEE1275-ly correct, but I can see how that would be convenient. Applied.
Quoted 20 lines
--- checks.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)checks.c +1
-3@@ -891,10 +891,8 @@ static void check_pci_device_reg(struct check *c, struct dt_info *dti, struct noreturn ; prop =get_property (node,"reg" ); -if (!prop) { -FAIL (c, dti, node,"missing PCI reg property" ); +if (!prop)return ; - } cells = (cell_t *)prop->val.val;if (cells[1 ] || cells[2 ])
Signature · 4 lines
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