]> 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>
Fri, 8 Dec 2017 21:14:13 +0000 (13:14 -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>
xen/arch/arm/bootfdt.c

index 4a687e725d3e533e5f2626246e586504def30d61..8eba42c7b95a854f0fb5f85932e5f52a40d52f78 100644 (file)
@@ -109,8 +109,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);