memory-hotplug: remove sysfs file of node
[linux-2.6-block.git] / drivers / acpi / acpi_memhotplug.c
index 034d3e72aa92d6dca344a5da1a756571ad3cc0f8..da1f82b445e013acab8410a8b075f8f1bb92955e 100644 (file)
@@ -280,9 +280,11 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
 
 static int acpi_memory_remove_memory(struct acpi_memory_device *mem_device)
 {
-       int result = 0;
+       int result = 0, nid;
        struct acpi_memory_info *info, *n;
 
+       nid = acpi_get_node(mem_device->device->handle);
+
        list_for_each_entry_safe(info, n, &mem_device->res_list, list) {
                if (info->failed)
                        /* The kernel does not use this memory block */
@@ -295,7 +297,9 @@ static int acpi_memory_remove_memory(struct acpi_memory_device *mem_device)
                         */
                        return -EBUSY;
 
-               result = remove_memory(info->start_addr, info->length);
+               if (nid < 0)
+                       nid = memory_add_physaddr_to_nid(info->start_addr);
+               result = remove_memory(nid, info->start_addr, info->length);
                if (result)
                        return result;