aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2009-06-22 16:41:25 -0400
committerLen Brown <len.brown@intel.com>2009-06-25 12:16:33 -0400
commit80f20fef6a2381402e59b169eb51b989cc175ab7 (patch)
tree2cfb84596f2ab12087bc0a8f6c9ecbbaa86c2803 /drivers/acpi
parent970b04929a68134acca17878b1d93e115e58c12a (diff)
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: Bjorn Helgaas <bjorn.helgaas@hp.com> Reviewed-by: Alex Chiang <achiang@hp.com> CC: Yasunori Goto <y-goto@jp.fujitsu.com> CC: Dave Hansen <haveblue@us.ibm.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpi_memhotplug.c40
1 files changed, 14 insertions, 26 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 7a0f4aa4fa1e..a8d9d8fac5d4 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -50,7 +50,6 @@ MODULE_LICENSE("GPL");
50 50
51static int acpi_memory_device_add(struct acpi_device *device); 51static int acpi_memory_device_add(struct acpi_device *device);
52static int acpi_memory_device_remove(struct acpi_device *device, int type); 52static int acpi_memory_device_remove(struct acpi_device *device, int type);
53static int acpi_memory_device_start(struct acpi_device *device);
54 53
55static const struct acpi_device_id memory_device_ids[] = { 54static const struct acpi_device_id memory_device_ids[] = {
56 {ACPI_MEMORY_DEVICE_HID, 0}, 55 {ACPI_MEMORY_DEVICE_HID, 0},
@@ -65,7 +64,6 @@ static struct acpi_driver acpi_memory_device_driver = {
65 .ops = { 64 .ops = {
66 .add = acpi_memory_device_add, 65 .add = acpi_memory_device_add,
67 .remove = acpi_memory_device_remove, 66 .remove = acpi_memory_device_remove,
68 .start = acpi_memory_device_start,
69 }, 67 },
70}; 68};
71 69
@@ -415,28 +413,6 @@ static int acpi_memory_device_add(struct acpi_device *device)
415 413
416 printk(KERN_DEBUG "%s \n", acpi_device_name(device)); 414 printk(KERN_DEBUG "%s \n", acpi_device_name(device));
417 415
418 return result;
419}
420
421static int acpi_memory_device_remove(struct acpi_device *device, int type)
422{
423 struct acpi_memory_device *mem_device = NULL;
424
425
426 if (!device || !acpi_driver_data(device))
427 return -EINVAL;
428
429 mem_device = acpi_driver_data(device);
430 kfree(mem_device);
431
432 return 0;
433}
434
435static int acpi_memory_device_start (struct acpi_device *device)
436{
437 struct acpi_memory_device *mem_device;
438 int result = 0;
439
440 /* 416 /*
441 * Early boot code has recognized memory area by EFI/E820. 417 * Early boot code has recognized memory area by EFI/E820.
442 * If DSDT shows these memory devices on boot, hotplug is not necessary 418 * 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 if (!acpi_hotmem_initialized) 422 if (!acpi_hotmem_initialized)
447 return 0; 423 return 0;
448 424
449 mem_device = acpi_driver_data(device);
450
451 if (!acpi_memory_check_device(mem_device)) { 425 if (!acpi_memory_check_device(mem_device)) {
452 /* call add_memory func */ 426 /* call add_memory func */
453 result = acpi_memory_enable_device(mem_device); 427 result = acpi_memory_enable_device(mem_device);
@@ -458,6 +432,20 @@ static int acpi_memory_device_start (struct acpi_device *device)
458 return result; 432 return result;
459} 433}
460 434
435static int acpi_memory_device_remove(struct acpi_device *device, int type)
436{
437 struct acpi_memory_device *mem_device = NULL;
438
439
440 if (!device || !acpi_driver_data(device))
441 return -EINVAL;
442
443 mem_device = acpi_driver_data(device);
444 kfree(mem_device);
445
446 return 0;
447}
448
461/* 449/*
462 * Helper function to check for memory device 450 * Helper function to check for memory device
463 */ 451 */