提交 80f20fef 编写于 作者: B Bjorn Helgaas 提交者: Len Brown

ACPI: memory hotplug: remove .start() method

This patch folds the .start() method into .add().

The .start() method is called in two paths: boot-time device enumeration
and run-time node addition, currently via container_device_add().  In both
cases, .start() is called immediately after .add(), so there's no reason
to make them separate methods.
Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
Reviewed-by: NAlex Chiang <achiang@hp.com>
CC: Yasunori Goto <y-goto@jp.fujitsu.com>
CC: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 970b0492
...@@ -50,7 +50,6 @@ MODULE_LICENSE("GPL"); ...@@ -50,7 +50,6 @@ MODULE_LICENSE("GPL");
static int acpi_memory_device_add(struct acpi_device *device); static int acpi_memory_device_add(struct acpi_device *device);
static int acpi_memory_device_remove(struct acpi_device *device, int type); static int acpi_memory_device_remove(struct acpi_device *device, int type);
static int acpi_memory_device_start(struct acpi_device *device);
static const struct acpi_device_id memory_device_ids[] = { static const struct acpi_device_id memory_device_ids[] = {
{ACPI_MEMORY_DEVICE_HID, 0}, {ACPI_MEMORY_DEVICE_HID, 0},
...@@ -65,7 +64,6 @@ static struct acpi_driver acpi_memory_device_driver = { ...@@ -65,7 +64,6 @@ static struct acpi_driver acpi_memory_device_driver = {
.ops = { .ops = {
.add = acpi_memory_device_add, .add = acpi_memory_device_add,
.remove = acpi_memory_device_remove, .remove = acpi_memory_device_remove,
.start = acpi_memory_device_start,
}, },
}; };
...@@ -415,28 +413,6 @@ static int acpi_memory_device_add(struct acpi_device *device) ...@@ -415,28 +413,6 @@ static int acpi_memory_device_add(struct acpi_device *device)
printk(KERN_DEBUG "%s \n", acpi_device_name(device)); printk(KERN_DEBUG "%s \n", acpi_device_name(device));
return result;
}
static int acpi_memory_device_remove(struct acpi_device *device, int type)
{
struct acpi_memory_device *mem_device = NULL;
if (!device || !acpi_driver_data(device))
return -EINVAL;
mem_device = acpi_driver_data(device);
kfree(mem_device);
return 0;
}
static int acpi_memory_device_start (struct acpi_device *device)
{
struct acpi_memory_device *mem_device;
int result = 0;
/* /*
* Early boot code has recognized memory area by EFI/E820. * Early boot code has recognized memory area by EFI/E820.
* If DSDT shows these memory devices on boot, hotplug is not necessary * If DSDT shows these memory devices on boot, hotplug is not necessary
...@@ -446,8 +422,6 @@ static int acpi_memory_device_start (struct acpi_device *device) ...@@ -446,8 +422,6 @@ static int acpi_memory_device_start (struct acpi_device *device)
if (!acpi_hotmem_initialized) if (!acpi_hotmem_initialized)
return 0; return 0;
mem_device = acpi_driver_data(device);
if (!acpi_memory_check_device(mem_device)) { if (!acpi_memory_check_device(mem_device)) {
/* call add_memory func */ /* call add_memory func */
result = acpi_memory_enable_device(mem_device); result = acpi_memory_enable_device(mem_device);
...@@ -458,6 +432,20 @@ static int acpi_memory_device_start (struct acpi_device *device) ...@@ -458,6 +432,20 @@ static int acpi_memory_device_start (struct acpi_device *device)
return result; return result;
} }
static int acpi_memory_device_remove(struct acpi_device *device, int type)
{
struct acpi_memory_device *mem_device = NULL;
if (!device || !acpi_driver_data(device))
return -EINVAL;
mem_device = acpi_driver_data(device);
kfree(mem_device);
return 0;
}
/* /*
* Helper function to check for memory device * Helper function to check for memory device
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册