aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/bus.c
diff options
context:
space:
mode:
authorAlexey Starikovskiy <astarikovskiy@suse.de>2007-09-26 11:43:16 -0400
committerLen Brown <len.brown@intel.com>2007-09-27 15:50:22 -0400
commit8db85d4c9a0cc131242c80ef8456362d66561dc2 (patch)
treec5f945ed1bc8b2ff9ba099a09d737bec5c776028 /drivers/acpi/bus.c
parent3e58ea0d31659b22ba5753f7abf3d7db346eab81 (diff)
ACPI: Add acpi_bus_generate_event4() function
acpi_bus_generate_event() takes two strings out of passed device object. SBS needs to supply these strings directly. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r--drivers/acpi/bus.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 9ba778a2b484..a54234d3aac1 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -284,15 +284,11 @@ DECLARE_WAIT_QUEUE_HEAD(acpi_bus_event_queue);
284 284
285extern int event_is_open; 285extern int event_is_open;
286 286
287int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data) 287int acpi_bus_generate_proc_event4(const char *device_class, const char *bus_id, u8 type, int data)
288{ 288{
289 struct acpi_bus_event *event = NULL; 289 struct acpi_bus_event *event;
290 unsigned long flags = 0; 290 unsigned long flags = 0;
291 291
292
293 if (!device)
294 return -EINVAL;
295
296 /* drop event on the floor if no one's listening */ 292 /* drop event on the floor if no one's listening */
297 if (!event_is_open) 293 if (!event_is_open)
298 return 0; 294 return 0;
@@ -301,8 +297,8 @@ int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
301 if (!event) 297 if (!event)
302 return -ENOMEM; 298 return -ENOMEM;
303 299
304 strcpy(event->device_class, device->pnp.device_class); 300 strcpy(event->device_class, device_class);
305 strcpy(event->bus_id, device->pnp.bus_id); 301 strcpy(event->bus_id, bus_id);
306 event->type = type; 302 event->type = type;
307 event->data = data; 303 event->data = data;
308 304
@@ -313,6 +309,17 @@ int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
313 wake_up_interruptible(&acpi_bus_event_queue); 309 wake_up_interruptible(&acpi_bus_event_queue);
314 310
315 return 0; 311 return 0;
312
313}
314
315EXPORT_SYMBOL_GPL(acpi_bus_generate_proc_event4);
316
317int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
318{
319 if (!device)
320 return -EINVAL;
321 return acpi_bus_generate_proc_event4(device->pnp.device_class,
322 device->pnp.bus_id, type, data);
316} 323}
317 324
318EXPORT_SYMBOL(acpi_bus_generate_proc_event); 325EXPORT_SYMBOL(acpi_bus_generate_proc_event);