summaryrefslogtreecommitdiffstats
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.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 01e7b5bb3c1d..deab5f946090 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -10,14 +10,14 @@
*/
#include <linux/of.h>
-#include <linux/lmb.h>
+#include <linux/memblock.h>
#include <linux/vmalloc.h>
#include <asm/firmware.h>
#include <asm/machdep.h>
#include <asm/pSeries_reconfig.h>
#include <asm/sparsemem.h>
-static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size)
+static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size)
{
unsigned long start, start_pfn;
struct zone *zone;
@@ -26,7 +26,7 @@ static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size)
start_pfn = base >> PAGE_SHIFT;
if (!pfn_valid(start_pfn)) {
- lmb_remove(base, lmb_size);
+ memblock_remove(base, memblock_size);
return 0;
}
@@ -41,20 +41,20 @@ static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size)
* to sysfs "state" file and we can't remove sysfs entries
* while writing to it. So we have to defer it to here.
*/
- ret = __remove_pages(zone, start_pfn, lmb_size >> PAGE_SHIFT);
+ ret = __remove_pages(zone, start_pfn, memblock_size >> PAGE_SHIFT);
if (ret)
return ret;
/*
* Update memory regions for memory remove
*/
- lmb_remove(base, lmb_size);
+ memblock_remove(base, memblock_size);
/*
* Remove htab bolted mappings for this section of memory
*/
start = (unsigned long)__va(base);
- ret = remove_section_mapping(start, start + lmb_size);
+ ret = remove_section_mapping(start, start + memblock_size);
/* Ensure all vmalloc mappings are flushed in case they also
* hit that section of memory
@@ -69,7 +69,7 @@ static int pseries_remove_memory(struct device_node *np)
const char *type;
const unsigned int *regs;
unsigned long base;
- unsigned int lmb_size;
+ unsigned int memblock_size;
int ret = -EINVAL;
/*
@@ -80,16 +80,16 @@ static int pseries_remove_memory(struct device_node *np)
return 0;
/*
- * Find the bae address and size of the lmb
+ * Find the bae address and size of the memblock
*/
regs = of_get_property(np, "reg", NULL);
if (!regs)
return ret;
base = *(unsigned long *)regs;
- lmb_size = regs[3];
+ memblock_size = regs[3];
- ret = pseries_remove_lmb(base, lmb_size);
+ ret = pseries_remove_memblock(base, memblock_size);
return ret;
}
@@ -98,7 +98,7 @@ static int pseries_add_memory(struct device_node *np)
const char *type;
const unsigned int *regs;
unsigned long base;
- unsigned int lmb_size;
+ unsigned int memblock_size;
int ret = -EINVAL;
/*
@@ -109,43 +109,43 @@ static int pseries_add_memory(struct device_node *np)
return 0;
/*
- * Find the base and size of the lmb
+ * Find the base and size of the memblock
*/
regs = of_get_property(np, "reg", NULL);
if (!regs)
return ret;
base = *(unsigned long *)regs;
- lmb_size = regs[3];
+ memblock_size = regs[3];
/*
* Update memory region to represent the memory add
*/
- ret = lmb_add(base, lmb_size);
+ ret = memblock_add(base, memblock_size);
return (ret < 0) ? -EINVAL : 0;
}
static int pseries_drconf_memory(unsigned long *base, unsigned int action)
{
struct device_node *np;
- const unsigned long *lmb_size;
+ const unsigned long *memblock_size;
int rc;
np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
if (!np)
return -EINVAL;
- lmb_size = of_get_property(np, "ibm,lmb-size", NULL);
- if (!lmb_size) {
+ memblock_size = of_get_property(np, "ibm,memblock-size", NULL);
+ if (!memblock_size) {
of_node_put(np);
return -EINVAL;
}
if (action == PSERIES_DRCONF_MEM_ADD) {
- rc = lmb_add(*base, *lmb_size);
+ rc = memblock_add(*base, *memblock_size);
rc = (rc < 0) ? -EINVAL : 0;
} else if (action == PSERIES_DRCONF_MEM_REMOVE) {
- rc = pseries_remove_lmb(*base, *lmb_size);
+ rc = pseries_remove_memblock(*base, *memblock_size);
} else {
rc = -EINVAL;
}