aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c40
1 files changed, 7 insertions, 33 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index bc52192785f1..4fa416f94f52 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -363,43 +363,13 @@ static void acpi_scan_bus_device_check(void *data, u32 ost_source)
363 unlock_device_hotplug(); 363 unlock_device_hotplug();
364} 364}
365 365
366static void acpi_hotplug_unsupported(acpi_handle handle, u32 type)
367{
368 u32 ost_status;
369
370 switch (type) {
371 case ACPI_NOTIFY_BUS_CHECK:
372 acpi_handle_debug(handle,
373 "ACPI_NOTIFY_BUS_CHECK event: unsupported\n");
374 ost_status = ACPI_OST_SC_INSERT_NOT_SUPPORTED;
375 break;
376 case ACPI_NOTIFY_DEVICE_CHECK:
377 acpi_handle_debug(handle,
378 "ACPI_NOTIFY_DEVICE_CHECK event: unsupported\n");
379 ost_status = ACPI_OST_SC_INSERT_NOT_SUPPORTED;
380 break;
381 case ACPI_NOTIFY_EJECT_REQUEST:
382 acpi_handle_debug(handle,
383 "ACPI_NOTIFY_EJECT_REQUEST event: unsupported\n");
384 ost_status = ACPI_OST_SC_EJECT_NOT_SUPPORTED;
385 break;
386 default:
387 /* non-hotplug event; possibly handled by other handler */
388 return;
389 }
390
391 acpi_evaluate_hotplug_ost(handle, type, ost_status, NULL);
392}
393
394static void acpi_hotplug_notify_cb(acpi_handle handle, u32 type, void *data) 366static void acpi_hotplug_notify_cb(acpi_handle handle, u32 type, void *data)
395{ 367{
368 u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE;
396 struct acpi_scan_handler *handler = data; 369 struct acpi_scan_handler *handler = data;
397 struct acpi_device *adev; 370 struct acpi_device *adev;
398 acpi_status status; 371 acpi_status status;
399 372
400 if (!handler->hotplug.enabled)
401 return acpi_hotplug_unsupported(handle, type);
402
403 switch (type) { 373 switch (type) {
404 case ACPI_NOTIFY_BUS_CHECK: 374 case ACPI_NOTIFY_BUS_CHECK:
405 acpi_handle_debug(handle, "ACPI_NOTIFY_BUS_CHECK event\n"); 375 acpi_handle_debug(handle, "ACPI_NOTIFY_BUS_CHECK event\n");
@@ -409,6 +379,11 @@ static void acpi_hotplug_notify_cb(acpi_handle handle, u32 type, void *data)
409 break; 379 break;
410 case ACPI_NOTIFY_EJECT_REQUEST: 380 case ACPI_NOTIFY_EJECT_REQUEST:
411 acpi_handle_debug(handle, "ACPI_NOTIFY_EJECT_REQUEST event\n"); 381 acpi_handle_debug(handle, "ACPI_NOTIFY_EJECT_REQUEST event\n");
382 if (!handler->hotplug.enabled) {
383 acpi_handle_err(handle, "Eject disabled\n");
384 ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED;
385 goto err_out;
386 }
412 if (acpi_bus_get_device(handle, &adev)) 387 if (acpi_bus_get_device(handle, &adev))
413 goto err_out; 388 goto err_out;
414 389
@@ -428,8 +403,7 @@ static void acpi_hotplug_notify_cb(acpi_handle handle, u32 type, void *data)
428 return; 403 return;
429 404
430 err_out: 405 err_out:
431 acpi_evaluate_hotplug_ost(handle, type, 406 acpi_evaluate_hotplug_ost(handle, type, ost_code, NULL);
432 ACPI_OST_SC_NON_SPECIFIC_FAILURE, NULL);
433} 407}
434 408
435static ssize_t real_power_state_show(struct device *dev, 409static ssize_t real_power_state_show(struct device *dev,