diff mbox

[v4,25/27] xen/dts: replace get_val by dt_next_cell

Message ID 1379076574-28316-26-git-send-email-julien.grall@linaro.org
State Accepted, archived
Headers show

Commit Message

Julien Grall Sept. 13, 2013, 12:49 p.m. UTC
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/common/device_tree.c |   18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)
diff mbox

Patch

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index eac507d..ee58c52 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -154,25 +154,11 @@  static bool_t __init device_tree_node_compatible(const void *fdt, int node,
     return 0;
 }
 
-static void __init get_val(const __be32 **cell, u32 cells, u64 *val)
-{
-    *val = 0;
-
-    if ( cells > 2 )
-        early_panic("dtb value contains > 2 cells\n");
-
-    while ( cells-- )
-    {
-        *val <<= 32;
-        *val |= fdt32_to_cpu(*(*cell)++);
-    }
-}
-
 static void __init device_tree_get_reg(const __be32 **cell, u32 address_cells,
                                        u32 size_cells, u64 *start, u64 *size)
 {
-    get_val(cell, address_cells, start);
-    get_val(cell, size_cells, size);
+    *start = dt_next_cell(address_cells, cell);
+    *size = dt_next_cell(size_cells, cell);
 }
 
 void dt_get_range(const __be32 **cell, const struct dt_device_node *np,