aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sbs.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/sbs.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/sbs.c')
-rw-r--r--drivers/acpi/sbs.c46
1 files changed, 14 insertions, 32 deletions
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index a578986e3214..33ba4bf551ef 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -427,28 +427,6 @@ static int acpi_check_update_proc(struct acpi_sbs *sbs)
427 return 0; 427 return 0;
428} 428}
429 429
430static int acpi_sbs_generate_event(struct acpi_device *device,
431 int event, int state, char *bid, char *class)
432{
433 char bid_saved[5];
434 char class_saved[20];
435 int result = 0;
436
437 strcpy(bid_saved, acpi_device_bid(device));
438 strcpy(class_saved, acpi_device_class(device));
439
440 strcpy(acpi_device_bid(device), bid);
441 strcpy(acpi_device_class(device), class);
442
443 result = acpi_bus_generate_proc_event(device, event, state);
444
445 strcpy(acpi_device_bid(device), bid_saved);
446 strcpy(acpi_device_class(device), class_saved);
447
448 acpi_bus_generate_netlink_event(class, bid, event, state);
449 return result;
450}
451
452static int acpi_battery_get_present(struct acpi_battery *battery) 430static int acpi_battery_get_present(struct acpi_battery *battery)
453{ 431{
454 s16 state; 432 s16 state;
@@ -1452,15 +1430,17 @@ static int acpi_sbs_update_run(struct acpi_sbs *sbs, int id, int data_type)
1452 } 1430 }
1453 1431
1454 if (do_ac_init) { 1432 if (do_ac_init) {
1455 result = acpi_sbs_generate_event(sbs->device, 1433 result = acpi_bus_generate_proc_event4(ACPI_AC_CLASS,
1456 ACPI_SBS_AC_NOTIFY_STATUS,
1457 new_ac_present,
1458 ACPI_AC_DIR_NAME, 1434 ACPI_AC_DIR_NAME,
1459 ACPI_AC_CLASS); 1435 ACPI_SBS_AC_NOTIFY_STATUS,
1436 new_ac_present);
1460 if (result) { 1437 if (result) {
1461 ACPI_EXCEPTION((AE_INFO, AE_ERROR, 1438 ACPI_EXCEPTION((AE_INFO, AE_ERROR,
1462 "acpi_sbs_generate_event() failed")); 1439 "acpi_bus_generate_event4() failed"));
1463 } 1440 }
1441 acpi_bus_generate_netlink_event(ACPI_AC_CLASS, ACPI_AC_DIR_NAME,
1442 ACPI_SBS_AC_NOTIFY_STATUS,
1443 new_ac_present);
1464 } 1444 }
1465 1445
1466 if (data_type == DATA_TYPE_COMMON) { 1446 if (data_type == DATA_TYPE_COMMON) {
@@ -1568,14 +1548,16 @@ static int acpi_sbs_update_run(struct acpi_sbs *sbs, int id, int data_type)
1568 old_remaining_capacity != 1548 old_remaining_capacity !=
1569 battery->state.remaining_capacity) { 1549 battery->state.remaining_capacity) {
1570 sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id); 1550 sprintf(dir_name, ACPI_BATTERY_DIR_NAME, id);
1571 result = acpi_sbs_generate_event(sbs->device, 1551 result = acpi_bus_generate_proc_event4(ACPI_BATTERY_CLASS,
1572 ACPI_SBS_BATTERY_NOTIFY_STATUS,
1573 new_battery_present,
1574 dir_name, 1552 dir_name,
1575 ACPI_BATTERY_CLASS); 1553 ACPI_SBS_BATTERY_NOTIFY_STATUS,
1554 new_battery_present);
1555 acpi_bus_generate_netlink_event(ACPI_BATTERY_CLASS, dir_name,
1556 ACPI_SBS_BATTERY_NOTIFY_STATUS,
1557 new_battery_present);
1576 if (result) { 1558 if (result) {
1577 ACPI_EXCEPTION((AE_INFO, AE_ERROR, 1559 ACPI_EXCEPTION((AE_INFO, AE_ERROR,
1578 "acpi_sbs_generate_event() " 1560 "acpi_bus_generate_proc_event4() "
1579 "failed")); 1561 "failed"));
1580 } 1562 }
1581 } 1563 }