summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpi_memhotplug.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-26 00:36:44 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-26 00:36:44 +0100
commitcc38e519132f62d52db0a04d2eaed0d7c52fb165 (patch)
tree35baaba355d6fbc1d43e9ca12278156f3eeab910 /drivers/acpi/acpi_memhotplug.c
parent949db153b6466c6f7cad5a427ecea94985927311 (diff)
parentb8bd759acd05281abf88cddef30c57313c109697 (diff)
downloadblackbird-op-linux-cc38e519132f62d52db0a04d2eaed0d7c52fb165.tar.gz
blackbird-op-linux-cc38e519132f62d52db0a04d2eaed0d7c52fb165.zip
Merge branch 'acpi-scan' into acpi-cleanup
The following commits depend on the 'acpi-scan' material.
Diffstat (limited to 'drivers/acpi/acpi_memhotplug.c')
-rw-r--r--drivers/acpi/acpi_memhotplug.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index b679bf8478f7..03d18f290118 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -157,38 +157,26 @@ static int
acpi_memory_get_device(acpi_handle handle,
struct acpi_memory_device **mem_device)
{
- acpi_status status;
- acpi_handle phandle;
struct acpi_device *device = NULL;
- struct acpi_device *pdevice = NULL;
int result;
-
if (!acpi_bus_get_device(handle, &device) && device)
goto end;
- status = acpi_get_parent(handle, &phandle);
- if (ACPI_FAILURE(status)) {
- ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent"));
- return -EINVAL;
- }
-
- /* Get the parent device */
- result = acpi_bus_get_device(phandle, &pdevice);
- if (result) {
- acpi_handle_warn(phandle, "Cannot get acpi bus device\n");
- return -EINVAL;
- }
-
/*
* Now add the notified device. This creates the acpi_device
* and invokes .add function
*/
- result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
+ result = acpi_bus_scan(handle);
if (result) {
acpi_handle_warn(handle, "Cannot add acpi bus\n");
return -EINVAL;
}
+ result = acpi_bus_get_device(handle, &device);
+ if (result) {
+ acpi_handle_warn(handle, "Missing device object\n");
+ return -EINVAL;
+ }
end:
*mem_device = acpi_driver_data(device);
@@ -355,7 +343,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
break;
}
- ej_event->handle = handle;
+ ej_event->device = device;
ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
(void *)ej_event);
OpenPOWER on IntegriCloud