]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: bootfdt: Use proper default for #address-cells and #size-cells
authorJulien Grall <julien.grall@linaro.org>
Wed, 29 Nov 2017 17:57:32 +0000 (17:57 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Thu, 11 Jan 2018 20:33:35 +0000 (12:33 -0800)
Per the device-tree specific [1], when the property #address-cells
and  #size-cells are not present, the default value should be resp. 1
and 2.

[1] https://www.devicetree.org/downloads/devicetree-specification-v0.1-20160524.pdf

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
(cherry picked from commit c05aa4afac64ea687c1a2bf9277ba6552809495b)

xen/arch/arm/bootfdt.c

index d13063371ed149a2954809dc1268c06dfebf2f80..0ab6d7f9a7d158db4946aa15aa4cbeddaf7af37b 100644 (file)
@@ -110,8 +110,8 @@ int __init device_tree_for_each_node(const void *fdt,
             continue;
         }
 
-        as = depth > 0 ? address_cells[depth-1] : 0;
-        ss = depth > 0 ? size_cells[depth-1] : 0;
+        as = depth > 0 ? address_cells[depth-1] : DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
+        ss = depth > 0 ? size_cells[depth-1] : DT_ROOT_NODE_SIZE_CELLS_DEFAULT;
 
         address_cells[depth] = device_tree_get_u32(fdt, node,
                                                    "#address-cells", as);