diff options
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r-- | drivers/acpi/bus.c | 120 |
1 files changed, 0 insertions, 120 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 6fd27a9abcda..b587ec8257b2 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -89,27 +89,6 @@ static struct dmi_system_id dsdt_dmi_table[] __initdata = { | |||
89 | Device Management | 89 | Device Management |
90 | -------------------------------------------------------------------------- */ | 90 | -------------------------------------------------------------------------- */ |
91 | 91 | ||
92 | int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device) | ||
93 | { | ||
94 | acpi_status status; | ||
95 | |||
96 | if (!device) | ||
97 | return -EINVAL; | ||
98 | |||
99 | /* TBD: Support fixed-feature devices */ | ||
100 | |||
101 | status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device); | ||
102 | if (ACPI_FAILURE(status) || !*device) { | ||
103 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n", | ||
104 | handle)); | ||
105 | return -ENODEV; | ||
106 | } | ||
107 | |||
108 | return 0; | ||
109 | } | ||
110 | |||
111 | EXPORT_SYMBOL(acpi_bus_get_device); | ||
112 | |||
113 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, | 92 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, |
114 | unsigned long long *sta) | 93 | unsigned long long *sta) |
115 | { | 94 | { |
@@ -346,104 +325,6 @@ static void acpi_bus_osc_support(void) | |||
346 | } | 325 | } |
347 | 326 | ||
348 | /* -------------------------------------------------------------------------- | 327 | /* -------------------------------------------------------------------------- |
349 | Event Management | ||
350 | -------------------------------------------------------------------------- */ | ||
351 | |||
352 | #ifdef CONFIG_ACPI_PROC_EVENT | ||
353 | static DEFINE_SPINLOCK(acpi_bus_event_lock); | ||
354 | |||
355 | LIST_HEAD(acpi_bus_event_list); | ||
356 | DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue); | ||
357 | |||
358 | extern int event_is_open; | ||
359 | |||
360 | int acpi_bus_generate_proc_event4(const char *device_class, const char *bus_id, u8 type, int data) | ||
361 | { | ||
362 | struct acpi_bus_event *event; | ||
363 | unsigned long flags; | ||
364 | |||
365 | /* drop event on the floor if no one's listening */ | ||
366 | if (!event_is_open) | ||
367 | return 0; | ||
368 | |||
369 | event = kzalloc(sizeof(struct acpi_bus_event), GFP_ATOMIC); | ||
370 | if (!event) | ||
371 | return -ENOMEM; | ||
372 | |||
373 | strcpy(event->device_class, device_class); | ||
374 | strcpy(event->bus_id, bus_id); | ||
375 | event->type = type; | ||
376 | event->data = data; | ||
377 | |||
378 | spin_lock_irqsave(&acpi_bus_event_lock, flags); | ||
379 | list_add_tail(&event->node, &acpi_bus_event_list); | ||
380 | spin_unlock_irqrestore(&acpi_bus_event_lock, flags); | ||
381 | |||
382 | wake_up_interruptible(&acpi_bus_event_queue); | ||
383 | |||
384 | return 0; | ||
385 | |||
386 | } | ||
387 | |||
388 | EXPORT_SYMBOL_GPL(acpi_bus_generate_proc_event4); | ||
389 | |||
390 | int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data) | ||
391 | { | ||
392 | if (!device) | ||
393 | return -EINVAL; | ||
394 | return acpi_bus_generate_proc_event4(device->pnp.device_class, | ||
395 | device->pnp.bus_id, type, data); | ||
396 | } | ||
397 | |||
398 | EXPORT_SYMBOL(acpi_bus_generate_proc_event); | ||
399 | |||
400 | int acpi_bus_receive_event(struct acpi_bus_event *event) | ||
401 | { | ||
402 | unsigned long flags; | ||
403 | struct acpi_bus_event *entry = NULL; | ||
404 | |||
405 | DECLARE_WAITQUEUE(wait, current); | ||
406 | |||
407 | |||
408 | if (!event) | ||
409 | return -EINVAL; | ||
410 | |||
411 | if (list_empty(&acpi_bus_event_list)) { | ||
412 | |||
413 | set_current_state(TASK_INTERRUPTIBLE); | ||
414 | add_wait_queue(&acpi_bus_event_queue, &wait); | ||
415 | |||
416 | if (list_empty(&acpi_bus_event_list)) | ||
417 | schedule(); | ||
418 | |||
419 | remove_wait_queue(&acpi_bus_event_queue, &wait); | ||
420 | set_current_state(TASK_RUNNING); | ||
421 | |||
422 | if (signal_pending(current)) | ||
423 | return -ERESTARTSYS; | ||
424 | } | ||
425 | |||
426 | spin_lock_irqsave(&acpi_bus_event_lock, flags); | ||
427 | if (!list_empty(&acpi_bus_event_list)) { | ||
428 | entry = list_entry(acpi_bus_event_list.next, | ||
429 | struct acpi_bus_event, node); | ||
430 | list_del(&entry->node); | ||
431 | } | ||
432 | spin_unlock_irqrestore(&acpi_bus_event_lock, flags); | ||
433 | |||
434 | if (!entry) | ||
435 | return -ENODEV; | ||
436 | |||
437 | memcpy(event, entry, sizeof(struct acpi_bus_event)); | ||
438 | |||
439 | kfree(entry); | ||
440 | |||
441 | return 0; | ||
442 | } | ||
443 | |||
444 | #endif /* CONFIG_ACPI_PROC_EVENT */ | ||
445 | |||
446 | /* -------------------------------------------------------------------------- | ||
447 | Notification Handling | 328 | Notification Handling |
448 | -------------------------------------------------------------------------- */ | 329 | -------------------------------------------------------------------------- */ |
449 | 330 | ||
@@ -695,7 +576,6 @@ static int __init acpi_bus_init(void) | |||
695 | { | 576 | { |
696 | int result; | 577 | int result; |
697 | acpi_status status; | 578 | acpi_status status; |
698 | extern acpi_status acpi_os_initialize1(void); | ||
699 | 579 | ||
700 | acpi_os_initialize1(); | 580 | acpi_os_initialize1(); |
701 | 581 | ||