fix memory leak in fixed btusb_close
[safe/jmp/linux-2.6] / drivers / acpi / system.c
index c885904..d112829 100644 (file)
 
 #include <acpi/acpi_drivers.h>
 
+#define PREFIX "ACPI: "
+
 #define _COMPONENT             ACPI_SYSTEM_COMPONENT
 ACPI_MODULE_NAME("system");
-#ifdef MODULE_PARAM_PREFIX
-#undef MODULE_PARAM_PREFIX
-#endif
-#define MODULE_PARAM_PREFIX "acpi."
 
 #define ACPI_SYSTEM_CLASS              "system"
 #define ACPI_SYSTEM_DEVICE_NAME                "System"
 
 u32 acpi_irq_handled;
+u32 acpi_irq_not_handled;
 
 /*
  * Make ACPICA version work as module param
@@ -124,7 +123,7 @@ static void acpi_table_attr_init(struct acpi_table_attr *table_attr,
        table_attr->attr.size = 0;
        table_attr->attr.read = acpi_table_show;
        table_attr->attr.attr.name = table_attr->name;
-       table_attr->attr.attr.mode = 0444;
+       table_attr->attr.attr.mode = 0400;
 
        return;
 }
@@ -218,8 +217,9 @@ err:
 
 #define COUNT_GPE 0
 #define COUNT_SCI 1    /* acpi_irq_handled */
-#define COUNT_ERROR 2  /* other */
-#define NUM_COUNTERS_EXTRA 3
+#define COUNT_SCI_NOT 2        /* acpi_irq_not_handled */
+#define COUNT_ERROR 3  /* other */
+#define NUM_COUNTERS_EXTRA 4
 
 struct event_counter {
        u32 count;
@@ -321,6 +321,8 @@ static ssize_t counter_show(struct kobject *kobj,
 
        all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI].count =
                acpi_irq_handled;
+       all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI_NOT].count =
+               acpi_irq_not_handled;
        all_counters[num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_GPE].count =
                acpi_gpe_count;
 
@@ -367,6 +369,7 @@ static ssize_t counter_set(struct kobject *kobj,
                        all_counters[i].count = 0;
                acpi_gpe_count = 0;
                acpi_irq_handled = 0;
+               acpi_irq_not_handled = 0;
                goto end;
        }
 
@@ -460,6 +463,8 @@ void acpi_irq_stats_init(void)
                        sprintf(buffer, "gpe_all");
                else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI)
                        sprintf(buffer, "sci");
+               else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI_NOT)
+                       sprintf(buffer, "sci_not");
                else if (i == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_ERROR)
                        sprintf(buffer, "error");
                else
@@ -616,12 +621,9 @@ static int acpi_system_procfs_init(void)
 }
 #endif
 
-static int __init acpi_system_init(void)
+int __init acpi_system_init(void)
 {
-       int result = 0;
-
-       if (acpi_disabled)
-               return 0;
+       int result;
 
        result = acpi_system_procfs_init();
        if (result)
@@ -631,5 +633,3 @@ static int __init acpi_system_init(void)
 
        return result;
 }
-
-subsys_initcall(acpi_system_init);