aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common
diff options
context:
space:
mode:
authorJulien Grall <julien.grall@linaro.org>2013-09-13 13:49:13 +0100
committerIan Campbell <ian.campbell@citrix.com>2013-09-17 15:27:56 +0100
commit57e835e51420bf1ff793524bbd815a85291c51e4 (patch)
treec219a4d858822acde7b49901c5d7d468cb911a8e /xen/common
parent6db389ab3fc4214c4ed3df07253879dee2254edc (diff)
downloadxen-57e835e51420bf1ff793524bbd815a85291c51e4.tar.gz
xen-57e835e51420bf1ff793524bbd815a85291c51e4.tar.bz2
xen-57e835e51420bf1ff793524bbd815a85291c51e4.zip
xen/dts: Remove device_get_reg call in process_cpu_node
The "reg" property is only composed of one uint32. device_get_reg can be replaced by dt_read_number. Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen/common')
-rw-r--r--xen/common/device_tree.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index a73eee804c..f867dfd969 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -426,21 +426,26 @@ static void __init process_cpu_node(const void *fdt, int node,
u32 address_cells, u32 size_cells)
{
const struct fdt_property *prop;
- const u32 *cell;
- paddr_t start, size;
-
+ u32 cpuid;
+ int len;
- prop = fdt_get_property(fdt, node, "reg", NULL);
+ prop = fdt_get_property(fdt, node, "reg", &len);
if ( !prop )
{
early_printk("fdt: node `%s': missing `reg' property\n", name);
return;
}
- cell = (const u32 *)prop->data;
- device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+ if ( len < sizeof (cpuid) )
+ {
+ dt_printk("fdt: node `%s': `reg` property length is too short\n",
+ name);
+ return;
+ }
+
+ cpuid = dt_read_number((const __be32 *)prop->data, 1);
- cpumask_set_cpu(start, &cpu_possible_map);
+ cpumask_set_cpu(cpuid, &cpu_possible_map);
}
static void __init process_multiboot_node(const void *fdt, int node,