Merge "Revert "arm: cpu: read all address cells in dt for cpuid""

This commit is contained in:
Linux Build Service Account 2017-05-26 00:10:30 -07:00 committed by Gerrit - the friendly Code Review server
commit c5a3a7fe46

View file

@ -87,9 +87,9 @@ void __init arm_dt_init_cpu_maps(void)
return; return;
for_each_child_of_node(cpus, cpu) { for_each_child_of_node(cpus, cpu) {
const __be32 *cell;
int prop_bytes; int prop_bytes;
u32 hwid; u32 hwid;
const __be32 *cell;
if (of_node_cmp(cpu->type, "cpu")) if (of_node_cmp(cpu->type, "cpu"))
continue; continue;
@ -100,13 +100,14 @@ void __init arm_dt_init_cpu_maps(void)
* properties is considered invalid to build the * properties is considered invalid to build the
* cpu_logical_map. * cpu_logical_map.
*/ */
cell = of_get_property(cpu, "reg", NULL); cell = of_get_property(cpu, "reg", &prop_bytes);
if (!cell) { if (!cell || prop_bytes < sizeof(*cell)) {
pr_err("%s: missing reg property\n", cpu->full_name); pr_debug(" * %s missing reg property\n",
cpu->full_name);
of_node_put(cpu); of_node_put(cpu);
return; return;
} }
hwid = of_read_number(cell, of_n_addr_cells(cpu));
/* /*
* Bits n:24 must be set to 0 in the DT since the reg property * Bits n:24 must be set to 0 in the DT since the reg property
* defines the MPIDR[23:0]. * defines the MPIDR[23:0].