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:44 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2018-01-16 10:23:48 +0300
commit22508f3dc985f6ed948293297f728605075fe6a7 (patch)
treedaf20d36af95534d48d7deb352371672f75beca9 /arch/powerpc/mm/numa.c
parent35f80debaef07bdaeffbbb20a6e999d8ac47972c (diff)
downloadlinux-22508f3dc985f6ed948293297f728605075fe6a7.tar.xz
powerpc/numa: Look up device node in of_get_usable_memory()
Look up the device node for the usable memory property instead of having it passed in as a parameter. This changes precedes an update in which the calling routines for of_get_usable_memory() 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.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index a0214aa2dd78..baba6403488b 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -184,11 +184,19 @@ static const __be32 *of_get_associativity(struct device_node *dev)
* it exists (the property exists only in kexec/kdump kernels,
* added by kexec-tools)
*/
-static const __be32 *of_get_usable_memory(struct device_node *memory)
+static const __be32 *of_get_usable_memory(void)
{
+ struct device_node *memory;
const __be32 *prop;
u32 len;
+
+ memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
+ if (!memory)
+ return NULL;
+
prop = of_get_property(memory, "linux,drconf-usable-memory", &len);
+ of_node_put(memory);
+
if (!prop || len < sizeof(unsigned int))
return NULL;
return prop;
@@ -674,7 +682,7 @@ static void __init parse_drconf_memory(struct device_node *memory)
return;
/* check if this is a kexec/kdump kernel */
- usm = of_get_usable_memory(memory);
+ usm = of_get_usable_memory();
if (usm != NULL)
is_kexec_kdump = 1;