diff options
Diffstat (limited to 'drivers/acpi/event.c')
-rw-r--r-- | drivers/acpi/event.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c index ce8d3eec3911..bfa8b76de403 100644 --- a/drivers/acpi/event.c +++ b/drivers/acpi/event.c | |||
@@ -13,16 +13,15 @@ | |||
13 | #include <acpi/acpi_drivers.h> | 13 | #include <acpi/acpi_drivers.h> |
14 | 14 | ||
15 | #define _COMPONENT ACPI_SYSTEM_COMPONENT | 15 | #define _COMPONENT ACPI_SYSTEM_COMPONENT |
16 | ACPI_MODULE_NAME ("event") | 16 | ACPI_MODULE_NAME("event") |
17 | 17 | ||
18 | /* Global vars for handling event proc entry */ | 18 | /* Global vars for handling event proc entry */ |
19 | static DEFINE_SPINLOCK(acpi_system_event_lock); | 19 | static DEFINE_SPINLOCK(acpi_system_event_lock); |
20 | int event_is_open = 0; | 20 | int event_is_open = 0; |
21 | extern struct list_head acpi_bus_event_list; | 21 | extern struct list_head acpi_bus_event_list; |
22 | extern wait_queue_head_t acpi_bus_event_queue; | 22 | extern wait_queue_head_t acpi_bus_event_queue; |
23 | 23 | ||
24 | static int | 24 | static int acpi_system_open_event(struct inode *inode, struct file *file) |
25 | acpi_system_open_event(struct inode *inode, struct file *file) | ||
26 | { | 25 | { |
27 | spin_lock_irq(&acpi_system_event_lock); | 26 | spin_lock_irq(&acpi_system_event_lock); |
28 | 27 | ||
@@ -34,20 +33,20 @@ acpi_system_open_event(struct inode *inode, struct file *file) | |||
34 | spin_unlock_irq(&acpi_system_event_lock); | 33 | spin_unlock_irq(&acpi_system_event_lock); |
35 | return 0; | 34 | return 0; |
36 | 35 | ||
37 | out_busy: | 36 | out_busy: |
38 | spin_unlock_irq(&acpi_system_event_lock); | 37 | spin_unlock_irq(&acpi_system_event_lock); |
39 | return -EBUSY; | 38 | return -EBUSY; |
40 | } | 39 | } |
41 | 40 | ||
42 | static ssize_t | 41 | static ssize_t |
43 | acpi_system_read_event(struct file *file, char __user *buffer, size_t count, loff_t *ppos) | 42 | acpi_system_read_event(struct file *file, char __user * buffer, size_t count, |
43 | loff_t * ppos) | ||
44 | { | 44 | { |
45 | int result = 0; | 45 | int result = 0; |
46 | struct acpi_bus_event event; | 46 | struct acpi_bus_event event; |
47 | static char str[ACPI_MAX_STRING]; | 47 | static char str[ACPI_MAX_STRING]; |
48 | static int chars_remaining = 0; | 48 | static int chars_remaining = 0; |
49 | static char *ptr; | 49 | static char *ptr; |
50 | |||
51 | 50 | ||
52 | ACPI_FUNCTION_TRACE("acpi_system_read_event"); | 51 | ACPI_FUNCTION_TRACE("acpi_system_read_event"); |
53 | 52 | ||
@@ -63,10 +62,12 @@ acpi_system_read_event(struct file *file, char __user *buffer, size_t count, lof | |||
63 | return_VALUE(-EIO); | 62 | return_VALUE(-EIO); |
64 | } | 63 | } |
65 | 64 | ||
66 | chars_remaining = sprintf(str, "%s %s %08x %08x\n", | 65 | chars_remaining = sprintf(str, "%s %s %08x %08x\n", |
67 | event.device_class?event.device_class:"<unknown>", | 66 | event.device_class ? event. |
68 | event.bus_id?event.bus_id:"<unknown>", | 67 | device_class : "<unknown>", |
69 | event.type, event.data); | 68 | event.bus_id ? event. |
69 | bus_id : "<unknown>", event.type, | ||
70 | event.data); | ||
70 | ptr = str; | 71 | ptr = str; |
71 | } | 72 | } |
72 | 73 | ||
@@ -84,17 +85,15 @@ acpi_system_read_event(struct file *file, char __user *buffer, size_t count, lof | |||
84 | return_VALUE(count); | 85 | return_VALUE(count); |
85 | } | 86 | } |
86 | 87 | ||
87 | static int | 88 | static int acpi_system_close_event(struct inode *inode, struct file *file) |
88 | acpi_system_close_event(struct inode *inode, struct file *file) | ||
89 | { | 89 | { |
90 | spin_lock_irq (&acpi_system_event_lock); | 90 | spin_lock_irq(&acpi_system_event_lock); |
91 | event_is_open = 0; | 91 | event_is_open = 0; |
92 | spin_unlock_irq (&acpi_system_event_lock); | 92 | spin_unlock_irq(&acpi_system_event_lock); |
93 | return 0; | 93 | return 0; |
94 | } | 94 | } |
95 | 95 | ||
96 | static unsigned int | 96 | static unsigned int acpi_system_poll_event(struct file *file, poll_table * wait) |
97 | acpi_system_poll_event(struct file *file, poll_table *wait) | ||
98 | { | 97 | { |
99 | poll_wait(file, &acpi_bus_event_queue, wait); | 98 | poll_wait(file, &acpi_bus_event_queue, wait); |
100 | if (!list_empty(&acpi_bus_event_list)) | 99 | if (!list_empty(&acpi_bus_event_list)) |
@@ -103,15 +102,15 @@ acpi_system_poll_event(struct file *file, poll_table *wait) | |||
103 | } | 102 | } |
104 | 103 | ||
105 | static struct file_operations acpi_system_event_ops = { | 104 | static struct file_operations acpi_system_event_ops = { |
106 | .open = acpi_system_open_event, | 105 | .open = acpi_system_open_event, |
107 | .read = acpi_system_read_event, | 106 | .read = acpi_system_read_event, |
108 | .release = acpi_system_close_event, | 107 | .release = acpi_system_close_event, |
109 | .poll = acpi_system_poll_event, | 108 | .poll = acpi_system_poll_event, |
110 | }; | 109 | }; |
111 | 110 | ||
112 | static int __init acpi_event_init(void) | 111 | static int __init acpi_event_init(void) |
113 | { | 112 | { |
114 | struct proc_dir_entry *entry; | 113 | struct proc_dir_entry *entry; |
115 | int error = 0; | 114 | int error = 0; |
116 | 115 | ||
117 | ACPI_FUNCTION_TRACE("acpi_event_init"); | 116 | ACPI_FUNCTION_TRACE("acpi_event_init"); |
@@ -124,8 +123,9 @@ static int __init acpi_event_init(void) | |||
124 | if (entry) | 123 | if (entry) |
125 | entry->proc_fops = &acpi_system_event_ops; | 124 | entry->proc_fops = &acpi_system_event_ops; |
126 | else { | 125 | else { |
127 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 126 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
128 | "Unable to create '%s' proc fs entry\n","event" )); | 127 | "Unable to create '%s' proc fs entry\n", |
128 | "event")); | ||
129 | error = -EFAULT; | 129 | error = -EFAULT; |
130 | } | 130 | } |
131 | return_VALUE(error); | 131 | return_VALUE(error); |