aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/hotplug-memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/pseries/hotplug-memory.c')
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-memory.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 7f75c94af822..7995135170a3 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -21,7 +21,7 @@
21#include <asm/prom.h> 21#include <asm/prom.h>
22#include <asm/sparsemem.h> 22#include <asm/sparsemem.h>
23 23
24static unsigned long get_memblock_size(void) 24unsigned long pseries_memory_block_size(void)
25{ 25{
26 struct device_node *np; 26 struct device_node *np;
27 unsigned int memblock_size = MIN_MEMORY_BLOCK_SIZE; 27 unsigned int memblock_size = MIN_MEMORY_BLOCK_SIZE;
@@ -64,17 +64,6 @@ static unsigned long get_memblock_size(void)
64 return memblock_size; 64 return memblock_size;
65} 65}
66 66
67/* WARNING: This is going to override the generic definition whenever
68 * pseries is built-in regardless of what platform is active at boot
69 * time. This is fine for now as this is the only "option" and it
70 * should work everywhere. If not, we'll have to turn this into a
71 * ppc_md. callback
72 */
73unsigned long memory_block_size_bytes(void)
74{
75 return get_memblock_size();
76}
77
78#ifdef CONFIG_MEMORY_HOTREMOVE 67#ifdef CONFIG_MEMORY_HOTREMOVE
79static int pseries_remove_memory(u64 start, u64 size) 68static int pseries_remove_memory(u64 start, u64 size)
80{ 69{
@@ -105,7 +94,7 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz
105 if (!pfn_valid(start_pfn)) 94 if (!pfn_valid(start_pfn))
106 goto out; 95 goto out;
107 96
108 block_sz = memory_block_size_bytes(); 97 block_sz = pseries_memory_block_size();
109 sections_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE; 98 sections_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE;
110 nid = memory_add_physaddr_to_nid(base); 99 nid = memory_add_physaddr_to_nid(base);
111 100
@@ -201,7 +190,7 @@ static int pseries_update_drconf_memory(struct of_prop_reconfig *pr)
201 u32 *p; 190 u32 *p;
202 int i, rc = -EINVAL; 191 int i, rc = -EINVAL;
203 192
204 memblock_size = get_memblock_size(); 193 memblock_size = pseries_memory_block_size();
205 if (!memblock_size) 194 if (!memblock_size)
206 return -EINVAL; 195 return -EINVAL;
207 196