aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2013-01-11 17:40:41 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-15 07:24:59 -0500
commit5993c4670ea2453ef5abb45b312f150e994e6eb9 (patch)
tree5ff0ec317a707caa905dd33d46e66e19b933384d /drivers
parent05404d8f7b5c831e1a2c24bb782f0fe8ea02354c (diff)
ACPI: update ej_event interface to take acpi_device
Should use acpi_device pointer directly instead of use handle and get the device pointer again later. Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/acpi_memhotplug.c2
-rw-r--r--drivers/acpi/processor_driver.c2
-rw-r--r--drivers/acpi/scan.c14
3 files changed, 6 insertions, 12 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 327ab4459558..eaddb7a89c70 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -361,7 +361,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
361 break; 361 break;
362 } 362 }
363 363
364 ej_event->handle = handle; 364 ej_event->device = device;
365 ej_event->event = ACPI_NOTIFY_EJECT_REQUEST; 365 ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
366 acpi_os_hotplug_execute(acpi_bus_hot_remove_device, 366 acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
367 (void *)ej_event); 367 (void *)ej_event);
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 0777663f443e..a24ee43e06e4 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -733,7 +733,7 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
733 break; 733 break;
734 } 734 }
735 735
736 ej_event->handle = handle; 736 ej_event->device = device;
737 ej_event->event = ACPI_NOTIFY_EJECT_REQUEST; 737 ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
738 acpi_os_hotplug_execute(acpi_bus_hot_remove_device, 738 acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
739 (void *)ej_event); 739 (void *)ej_event);
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index d04d0b33656c..388b59c096dc 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -116,20 +116,14 @@ static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL);
116void acpi_bus_hot_remove_device(void *context) 116void acpi_bus_hot_remove_device(void *context)
117{ 117{
118 struct acpi_eject_event *ej_event = (struct acpi_eject_event *) context; 118 struct acpi_eject_event *ej_event = (struct acpi_eject_event *) context;
119 struct acpi_device *device; 119 struct acpi_device *device = ej_event->device;
120 acpi_handle handle = ej_event->handle; 120 acpi_handle handle = device->handle;
121 acpi_handle temp; 121 acpi_handle temp;
122 struct acpi_object_list arg_list; 122 struct acpi_object_list arg_list;
123 union acpi_object arg; 123 union acpi_object arg;
124 acpi_status status = AE_OK; 124 acpi_status status = AE_OK;
125 u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ 125 u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */
126 126
127 if (acpi_bus_get_device(handle, &device))
128 goto err_out;
129
130 if (!device)
131 goto err_out;
132
133 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 127 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
134 "Hot-removing device %s...\n", dev_name(&device->dev))); 128 "Hot-removing device %s...\n", dev_name(&device->dev)));
135 129
@@ -215,7 +209,7 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
215 goto err; 209 goto err;
216 } 210 }
217 211
218 ej_event->handle = acpi_device->handle; 212 ej_event->device = acpi_device;
219 if (acpi_device->flags.eject_pending) { 213 if (acpi_device->flags.eject_pending) {
220 /* event originated from ACPI eject notification */ 214 /* event originated from ACPI eject notification */
221 ej_event->event = ACPI_NOTIFY_EJECT_REQUEST; 215 ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
@@ -223,7 +217,7 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
223 } else { 217 } else {
224 /* event originated from user */ 218 /* event originated from user */
225 ej_event->event = ACPI_OST_EC_OSPM_EJECT; 219 ej_event->event = ACPI_OST_EC_OSPM_EJECT;
226 (void) acpi_evaluate_hotplug_ost(ej_event->handle, 220 (void) acpi_evaluate_hotplug_ost(acpi_device->handle,
227 ej_event->event, ACPI_OST_SC_EJECT_IN_PROGRESS, NULL); 221 ej_event->event, ACPI_OST_SC_EJECT_IN_PROGRESS, NULL);
228 } 222 }
229 223