aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorYasunori Goto <y-goto@jp.fujitsu.com>2006-06-27 05:53:28 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-27 20:32:35 -0400
commit1f425994f96d85540d47eee98daabc1e211b454e (patch)
tree820fc7856da7a751bf91ed25fdc294319297d74e /drivers/acpi
parent9ac023989e6dd1b97140b47fb942a7940d0b2af2 (diff)
[PATCH] Catch notification of memory add event of ACPI via container driver. (register start func for memory device)
This is a patch to call add_memroy() when notify reaches for new node's add event. When new node is added, notify of ACPI reaches container device which means the node. Container device driver calls acpi_bus_scan() to find and add belonging devices (which means cpu, memory and so on). Its function calls add and start function of belonging devices's driver. Howevever, current memory hotplug driver just register add function to create sysfs file for its memory. But, acpi_memory_enable_device() is not called because it is considered just the case that notify reaches memory device directly. So, if notify reaches container device nothing can call add_memory(). This is a patch to create start function which calls add_memory(). add_memory() can be called by this when notify reaches container device. [akpm@osdl.org: coding cleanups] Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com> Cc: "Brown, Len" <len.brown@intel.com> Cc: Dave Hansen <haveblue@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpi_memhotplug.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 1486e03bb41a..3721f8dd0de3 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -57,6 +57,7 @@ MODULE_LICENSE("GPL");
57 57
58static int acpi_memory_device_add(struct acpi_device *device); 58static int acpi_memory_device_add(struct acpi_device *device);
59static int acpi_memory_device_remove(struct acpi_device *device, int type); 59static int acpi_memory_device_remove(struct acpi_device *device, int type);
60static int acpi_memory_device_start(struct acpi_device *device);
60 61
61static struct acpi_driver acpi_memory_device_driver = { 62static struct acpi_driver acpi_memory_device_driver = {
62 .name = ACPI_MEMORY_DEVICE_DRIVER_NAME, 63 .name = ACPI_MEMORY_DEVICE_DRIVER_NAME,
@@ -65,6 +66,7 @@ static struct acpi_driver acpi_memory_device_driver = {
65 .ops = { 66 .ops = {
66 .add = acpi_memory_device_add, 67 .add = acpi_memory_device_add,
67 .remove = acpi_memory_device_remove, 68 .remove = acpi_memory_device_remove,
69 .start = acpi_memory_device_start,
68 }, 70 },
69}; 71};
70 72
@@ -433,6 +435,25 @@ static int acpi_memory_device_remove(struct acpi_device *device, int type)
433 return_VALUE(0); 435 return_VALUE(0);
434} 436}
435 437
438static int acpi_memory_device_start (struct acpi_device *device)
439{
440 struct acpi_memory_device *mem_device;
441 int result = 0;
442
443 ACPI_FUNCTION_TRACE("acpi_memory_device_start");
444
445 mem_device = acpi_driver_data(device);
446
447 if (!acpi_memory_check_device(mem_device)) {
448 /* call add_memory func */
449 result = acpi_memory_enable_device(mem_device);
450 if (result)
451 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
452 "Error in acpi_memory_enable_device\n"));
453 }
454 return_VALUE(result);
455}
456
436/* 457/*
437 * Helper function to check for memory device 458 * Helper function to check for memory device
438 */ 459 */