diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-05-26 00:10:30 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-05-26 00:10:29 -0700 |
| commit | c5a3a7fe4632f7d30a3f60fa99de7b3a1c22b6ca (patch) | |
| tree | 780986c19e4c5ae4b0733c51f21e8d011c77513c /arch/arm | |
| parent | 7d371c9315fe081fdf704d315e6994a71779b8e3 (diff) | |
| parent | ca484744571baf9f3d896d628089a7669631e96e (diff) | |
Merge "Revert "arm: cpu: read all address cells in dt for cpuid""
Diffstat (limited to 'arch/arm')
| -rw-r--r-- | arch/arm/kernel/devtree.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c index da3cafbd682b..b3b950fc8ea0 100644 --- a/arch/arm/kernel/devtree.c +++ b/arch/arm/kernel/devtree.c @@ -87,9 +87,9 @@ void __init arm_dt_init_cpu_maps(void) return; for_each_child_of_node(cpus, cpu) { + const __be32 *cell; int prop_bytes; u32 hwid; - const __be32 *cell; if (of_node_cmp(cpu->type, "cpu")) continue; @@ -100,13 +100,14 @@ void __init arm_dt_init_cpu_maps(void) * properties is considered invalid to build the * cpu_logical_map. */ - cell = of_get_property(cpu, "reg", NULL); - if (!cell) { - pr_err("%s: missing reg property\n", cpu->full_name); + cell = of_get_property(cpu, "reg", &prop_bytes); + if (!cell || prop_bytes < sizeof(*cell)) { + pr_debug(" * %s missing reg property\n", + cpu->full_name); of_node_put(cpu); 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 * defines the MPIDR[23:0]. |
