===================================================================
@@ -487,7 +487,6 @@ static void acpi_device_hotplug(void *da
static void acpi_hotplug_notify_cb(acpi_handle handle, u32 type, void *data)
{
- struct acpi_scan_handler *handler = data;
u32 ost_code = ACPI_OST_SC_SUCCESS;
struct acpi_device *adev;
acpi_status status;
@@ -503,13 +502,6 @@ static void acpi_hotplug_notify_cb(acpi_
case ACPI_NOTIFY_EJECT_REQUEST:
acpi_handle_debug(handle, "ACPI_NOTIFY_EJECT_REQUEST event\n");
- if (handler && !handler->hotplug.enabled) {
- acpi_handle_err(handle, "Eject disabled\n");
- ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED;
- goto out;
- }
- acpi_evaluate_hotplug_ost(handle, ACPI_NOTIFY_EJECT_REQUEST,
- ACPI_OST_SC_EJECT_IN_PROGRESS, NULL);
break;
case ACPI_NOTIFY_DEVICE_WAKE:
@@ -539,6 +531,15 @@ static void acpi_hotplug_notify_cb(acpi_
if (acpi_bus_get_device(handle, &adev))
goto out;
+ if (type == ACPI_NOTIFY_EJECT_REQUEST) {
+ if (adev->handler && !adev->handler->hotplug.enabled) {
+ acpi_handle_err(handle, "Eject disabled\n");
+ ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED;
+ goto out;
+ }
+ acpi_evaluate_hotplug_ost(handle, ACPI_NOTIFY_EJECT_REQUEST,
+ ACPI_OST_SC_EJECT_IN_PROGRESS, NULL);
+ }
get_device(&adev->dev);
status = acpi_hotplug_execute(acpi_device_hotplug, adev, type);
if (ACPI_SUCCESS(status))
@@ -550,10 +551,10 @@ static void acpi_hotplug_notify_cb(acpi_
acpi_evaluate_hotplug_ost(handle, type, ost_code, NULL);
}
-void acpi_install_hotplug_notify_handler(acpi_handle handle, void *data)
+void acpi_install_hotplug_notify_handler(acpi_handle handle)
{
acpi_install_notify_handler(handle, ACPI_SYSTEM_NOTIFY,
- acpi_hotplug_notify_cb, data);
+ acpi_hotplug_notify_cb, NULL);
}
void acpi_remove_hotplug_notify_handler(acpi_handle handle)
@@ -2000,7 +2001,7 @@ static void acpi_scan_init_hotplug(acpi_
list_for_each_entry(hwid, &pnp.ids, list) {
handler = acpi_scan_match_handler(hwid->id, NULL);
if (handler) {
- acpi_install_hotplug_notify_handler(handle, handler);
+ acpi_install_hotplug_notify_handler(handle);
break;
}
}
===================================================================
@@ -371,7 +371,7 @@ static acpi_status register_slot(acpi_ha
/* install notify handler */
if (!(newfunc->flags & FUNC_HAS_DCK))
- acpi_install_hotplug_notify_handler(handle, NULL);
+ acpi_install_hotplug_notify_handler(handle);
return AE_OK;
}
===================================================================
@@ -435,7 +435,7 @@ static inline bool acpi_device_enumerate
typedef void (*acpi_hp_callback)(void *data, u32 src);
acpi_status acpi_hotplug_execute(acpi_hp_callback func, void *data, u32 src);
-void acpi_install_hotplug_notify_handler(acpi_handle handle, void *data);
+void acpi_install_hotplug_notify_handler(acpi_handle handle);
void acpi_remove_hotplug_notify_handler(acpi_handle handle);
/**