aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/sysfs.c')
-rw-r--r--drivers/acpi/sysfs.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
index f8588f81048a..61891e75583d 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
@@ -438,7 +438,7 @@ static void delete_gpe_attr_array(void)
438 return; 438 return;
439} 439}
440 440
441void acpi_os_gpe_count(u32 gpe_number) 441static void gpe_count(u32 gpe_number)
442{ 442{
443 acpi_gpe_count++; 443 acpi_gpe_count++;
444 444
@@ -454,7 +454,7 @@ void acpi_os_gpe_count(u32 gpe_number)
454 return; 454 return;
455} 455}
456 456
457void acpi_os_fixed_event_count(u32 event_number) 457static void fixed_event_count(u32 event_number)
458{ 458{
459 if (!all_counters) 459 if (!all_counters)
460 return; 460 return;
@@ -468,6 +468,16 @@ void acpi_os_fixed_event_count(u32 event_number)
468 return; 468 return;
469} 469}
470 470
471static void acpi_gbl_event_handler(u32 event_type, acpi_handle device,
472 u32 event_number, void *context)
473{
474 if (event_type == ACPI_EVENT_TYPE_GPE)
475 gpe_count(event_number);
476
477 if (event_type == ACPI_EVENT_TYPE_FIXED)
478 fixed_event_count(event_number);
479}
480
471static int get_status(u32 index, acpi_event_status *status, 481static int get_status(u32 index, acpi_event_status *status,
472 acpi_handle *handle) 482 acpi_handle *handle)
473{ 483{
@@ -601,6 +611,7 @@ end:
601 611
602void acpi_irq_stats_init(void) 612void acpi_irq_stats_init(void)
603{ 613{
614 acpi_status status;
604 int i; 615 int i;
605 616
606 if (all_counters) 617 if (all_counters)
@@ -619,6 +630,10 @@ void acpi_irq_stats_init(void)
619 if (all_counters == NULL) 630 if (all_counters == NULL)
620 goto fail; 631 goto fail;
621 632
633 status = acpi_install_global_event_handler(acpi_gbl_event_handler, NULL);
634 if (ACPI_FAILURE(status))
635 goto fail;
636
622 counter_attrs = kzalloc(sizeof(struct kobj_attribute) * (num_counters), 637 counter_attrs = kzalloc(sizeof(struct kobj_attribute) * (num_counters),
623 GFP_KERNEL); 638 GFP_KERNEL);
624 if (counter_attrs == NULL) 639 if (counter_attrs == NULL)