Subject: [RFC PATCH 5/8] memory-hotplug: call acpi_bus_remove() to remove memory device

From: Wen Congyang <[email-masked]>
Date: Fri, 20 Jul 2012 15:11:40 +0800

The memory device has been ejected and powoffed, so we can call
acpi_bus_remove() to remove the memory device from acpi bus.

CC: David Rientjes <[email-masked]>
CC: Jiang Liu <[email-masked]>
CC: Len Brown <[email-masked]>
CC: Benjamin Herrenschmidt <[email-masked]>
CC: Paul Mackerras <[email-masked]>
CC: Christoph Lameter <[email-masked]>
Cc: Minchan Kim <[email-masked]>
CC: Andrew Morton <[email-masked]>
CC: KOSAKI Motohiro <[email-masked]>
CC: Yasuaki Ishimatsu <[email-masked]>
Signed-off-by: Wen Congyang <[email-masked]>
---
 drivers/acpi/acpi_memhotplug.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 58e4e63..431a17c 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -402,8 +402,9 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
 			printk(KERN_ERR PREFIX
 				    "Disable memory device\n");
 		/*
-		 * TBD: Invoke acpi_bus_remove to cleanup data structures
+		 * Invoke acpi_bus_remove() to remove memory device
 		 */
+		acpi_bus_remove(device, 1);
 		break;
 	default:
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-- 
1.7.1