diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-10-13 09:43:54 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-10-13 09:43:54 -0400 |
commit | b160292cc216a50fd0cd386b0bda2cd48352c73b (patch) | |
tree | ef07cf98f91353ee4c9ec1e1ca7a2a5d9d4b538a /drivers/acpi/event.c | |
parent | b37bde147890c8fea8369a5a4e230dabdea4ebfb (diff) | |
parent | bbf25010f1a6b761914430f5fca081ec8c7accd1 (diff) |
Merge Linux 2.6.23
Diffstat (limited to 'drivers/acpi/event.c')
-rw-r--r-- | drivers/acpi/event.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c index 95637a4ff782..5c95863f8fa9 100644 --- a/drivers/acpi/event.c +++ b/drivers/acpi/event.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #define _COMPONENT ACPI_SYSTEM_COMPONENT | 17 | #define _COMPONENT ACPI_SYSTEM_COMPONENT |
18 | ACPI_MODULE_NAME("event"); | 18 | ACPI_MODULE_NAME("event"); |
19 | 19 | ||
20 | #ifdef CONFIG_ACPI_PROC_EVENT | ||
20 | /* Global vars for handling event proc entry */ | 21 | /* Global vars for handling event proc entry */ |
21 | static DEFINE_SPINLOCK(acpi_system_event_lock); | 22 | static DEFINE_SPINLOCK(acpi_system_event_lock); |
22 | int event_is_open = 0; | 23 | int event_is_open = 0; |
@@ -106,6 +107,7 @@ static const struct file_operations acpi_system_event_ops = { | |||
106 | .release = acpi_system_close_event, | 107 | .release = acpi_system_close_event, |
107 | .poll = acpi_system_poll_event, | 108 | .poll = acpi_system_poll_event, |
108 | }; | 109 | }; |
110 | #endif /* CONFIG_ACPI_PROC_EVENT */ | ||
109 | 111 | ||
110 | #ifdef CONFIG_NET | 112 | #ifdef CONFIG_NET |
111 | static unsigned int acpi_event_seqnum; | 113 | static unsigned int acpi_event_seqnum; |
@@ -147,7 +149,8 @@ static struct genl_multicast_group acpi_event_mcgrp = { | |||
147 | .name = ACPI_GENL_MCAST_GROUP_NAME, | 149 | .name = ACPI_GENL_MCAST_GROUP_NAME, |
148 | }; | 150 | }; |
149 | 151 | ||
150 | int acpi_bus_generate_genetlink_event(struct acpi_device *device, | 152 | int acpi_bus_generate_netlink_event(const char *device_class, |
153 | const char *bus_id, | ||
151 | u8 type, int data) | 154 | u8 type, int data) |
152 | { | 155 | { |
153 | struct sk_buff *skb; | 156 | struct sk_buff *skb; |
@@ -191,8 +194,8 @@ int acpi_bus_generate_genetlink_event(struct acpi_device *device, | |||
191 | 194 | ||
192 | memset(event, 0, sizeof(struct acpi_genl_event)); | 195 | memset(event, 0, sizeof(struct acpi_genl_event)); |
193 | 196 | ||
194 | strcpy(event->device_class, device->pnp.device_class); | 197 | strcpy(event->device_class, device_class); |
195 | strcpy(event->bus_id, device->dev.bus_id); | 198 | strcpy(event->bus_id, bus_id); |
196 | event->type = type; | 199 | event->type = type; |
197 | event->data = data; | 200 | event->data = data; |
198 | 201 | ||
@@ -211,6 +214,8 @@ int acpi_bus_generate_genetlink_event(struct acpi_device *device, | |||
211 | return 0; | 214 | return 0; |
212 | } | 215 | } |
213 | 216 | ||
217 | EXPORT_SYMBOL(acpi_bus_generate_netlink_event); | ||
218 | |||
214 | static int acpi_event_genetlink_init(void) | 219 | static int acpi_event_genetlink_init(void) |
215 | { | 220 | { |
216 | int result; | 221 | int result; |
@@ -228,12 +233,15 @@ static int acpi_event_genetlink_init(void) | |||
228 | } | 233 | } |
229 | 234 | ||
230 | #else | 235 | #else |
231 | int acpi_bus_generate_genetlink_event(struct acpi_device *device, u8 type, | 236 | int acpi_bus_generate_netlink_event(const char *device_class, |
232 | int data) | 237 | const char *bus_id, |
238 | u8 type, int data) | ||
233 | { | 239 | { |
234 | return 0; | 240 | return 0; |
235 | } | 241 | } |
236 | 242 | ||
243 | EXPORT_SYMBOL(acpi_bus_generate_netlink_event); | ||
244 | |||
237 | static int acpi_event_genetlink_init(void) | 245 | static int acpi_event_genetlink_init(void) |
238 | { | 246 | { |
239 | return -ENODEV; | 247 | return -ENODEV; |
@@ -242,7 +250,9 @@ static int acpi_event_genetlink_init(void) | |||
242 | 250 | ||
243 | static int __init acpi_event_init(void) | 251 | static int __init acpi_event_init(void) |
244 | { | 252 | { |
253 | #ifdef CONFIG_ACPI_PROC_EVENT | ||
245 | struct proc_dir_entry *entry; | 254 | struct proc_dir_entry *entry; |
255 | #endif | ||
246 | int error = 0; | 256 | int error = 0; |
247 | 257 | ||
248 | if (acpi_disabled) | 258 | if (acpi_disabled) |
@@ -254,12 +264,14 @@ static int __init acpi_event_init(void) | |||
254 | printk(KERN_WARNING PREFIX | 264 | printk(KERN_WARNING PREFIX |
255 | "Failed to create genetlink family for ACPI event\n"); | 265 | "Failed to create genetlink family for ACPI event\n"); |
256 | 266 | ||
267 | #ifdef CONFIG_ACPI_PROC_EVENT | ||
257 | /* 'event' [R] */ | 268 | /* 'event' [R] */ |
258 | entry = create_proc_entry("event", S_IRUSR, acpi_root_dir); | 269 | entry = create_proc_entry("event", S_IRUSR, acpi_root_dir); |
259 | if (entry) | 270 | if (entry) |
260 | entry->proc_fops = &acpi_system_event_ops; | 271 | entry->proc_fops = &acpi_system_event_ops; |
261 | else | 272 | else |
262 | return -ENODEV; | 273 | return -ENODEV; |
274 | #endif | ||
263 | 275 | ||
264 | return 0; | 276 | return 0; |
265 | } | 277 | } |