summaryrefslogtreecommitdiff
path: root/arch/powerpc/mm/numa.c
diff options
context:
space:
mode:
authorNathan Fontenot <nfont@linux.vnet.ibm.com>2017-12-01 19:46:35 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2018-01-16 10:23:47 +0300
commit35f80debaef07bdaeffbbb20a6e999d8ac47972c (patch)
tree6168c5ca92910615ed270a44fc3794968fc76e60 /arch/powerpc/mm/numa.c
parent6ed361586b323e576fd5536078fe9f2ee7906e61 (diff)
downloadlinux-35f80debaef07bdaeffbbb20a6e999d8ac47972c.tar.xz
powerpc/numa: Look up device node in of_get_assoc_arrays()
Look up the device node for the associativity array property instead of having it passed in as a parameter. This changes precedes an update in which the calling routines for of_get_assoc_arrays() will not have the device node pointer to pass in. Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/numa.c')
-rw-r--r--arch/powerpc/mm/numa.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index adb6364f4091..a0214aa2dd78 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -466,19 +466,27 @@ struct assoc_arrays {
* indicating the size of each associativity array, followed by a list
* of N associativity arrays.
*/
-static int of_get_assoc_arrays(struct device_node *memory,
- struct assoc_arrays *aa)
+static int of_get_assoc_arrays(struct assoc_arrays *aa)
{
+ struct device_node *memory;
const __be32 *prop;
u32 len;
+ memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
+ if (!memory)
+ return -1;
+
prop = of_get_property(memory, "ibm,associativity-lookup-arrays", &len);
- if (!prop || len < 2 * sizeof(unsigned int))
+ if (!prop || len < 2 * sizeof(unsigned int)) {
+ of_node_put(memory);
return -1;
+ }
aa->n_arrays = of_read_number(prop++, 1);
aa->array_sz = of_read_number(prop++, 1);
+ of_node_put(memory);
+
/* Now that we know the number of arrays and size of each array,
* revalidate the size of the property read in.
*/
@@ -661,7 +669,7 @@ static void __init parse_drconf_memory(struct device_node *memory)
if (!lmb_size)
return;
- rc = of_get_assoc_arrays(memory, &aa);
+ rc = of_get_assoc_arrays(&aa);
if (rc)
return;
@@ -996,7 +1004,7 @@ static int hot_add_drconf_scn_to_nid(struct device_node *memory,
if (!lmb_size)
return -1;
- rc = of_get_assoc_arrays(memory, &aa);
+ rc = of_get_assoc_arrays(&aa);
if (rc)
return -1;