aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-05-27 06:58:46 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-01 15:37:10 -0400
commit242831eb15a06fa4414eaa705fdc6dd432ab98d1 (patch)
tree65b57b16800e27b0354ef72a4fe1aecbf8b6d89a /drivers/acpi
parent303bfdb1a14d0460feb859cd008ff81da36b517c (diff)
Memory hotplug / ACPI: Simplify memory removal
Now that the memory offlining should be taken care of by the companion device offlining code in acpi_scan_hot_remove(), the ACPI memory hotplug driver doesn't need to offline it in remove_memory() any more. Moreover, since the return value of remove_memory() is not used, it's better to make it be a void function and trigger a BUG() if the memory scheduled for removal is not offline. Change the code in accordance with the above observations. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Toshi Kani <toshi.kani@hp.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpi_memhotplug.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 5590db12028e..c711d1144044 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -271,13 +271,11 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
271 return 0; 271 return 0;
272} 272}
273 273
274static int acpi_memory_remove_memory(struct acpi_memory_device *mem_device) 274static void acpi_memory_remove_memory(struct acpi_memory_device *mem_device)
275{ 275{
276 acpi_handle handle = mem_device->device->handle; 276 acpi_handle handle = mem_device->device->handle;
277 int result = 0, nid;
278 struct acpi_memory_info *info, *n; 277 struct acpi_memory_info *info, *n;
279 278 int nid = acpi_get_node(handle);
280 nid = acpi_get_node(handle);
281 279
282 list_for_each_entry_safe(info, n, &mem_device->res_list, list) { 280 list_for_each_entry_safe(info, n, &mem_device->res_list, list) {
283 if (!info->enabled) 281 if (!info->enabled)
@@ -287,15 +285,10 @@ static int acpi_memory_remove_memory(struct acpi_memory_device *mem_device)
287 nid = memory_add_physaddr_to_nid(info->start_addr); 285 nid = memory_add_physaddr_to_nid(info->start_addr);
288 286
289 acpi_unbind_memory_blocks(info, handle); 287 acpi_unbind_memory_blocks(info, handle);
290 result = remove_memory(nid, info->start_addr, info->length); 288 remove_memory(nid, info->start_addr, info->length);
291 if (result)
292 return result;
293
294 list_del(&info->list); 289 list_del(&info->list);
295 kfree(info); 290 kfree(info);
296 } 291 }
297
298 return result;
299} 292}
300 293
301static void acpi_memory_device_free(struct acpi_memory_device *mem_device) 294static void acpi_memory_device_free(struct acpi_memory_device *mem_device)