aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 */