Merge branches 'release' and 'stats' into release
[sfrench/cifs-2.6.git] / drivers / acpi / osl.c
index 347cda21c0ed2648650e5836d9dc508cf242f828..3b8aef3aefe59188f644ea80293c5e488553b644 100644 (file)
@@ -120,7 +120,7 @@ static char osi_additional_string[OSI_STRING_LENGTH_MAX];
  */
 #define OSI_LINUX_ENABLE 0
 
-struct osi_linux {
+static struct osi_linux {
        unsigned int    enable:1;
        unsigned int    dmi:1;
        unsigned int    cmdline:1;
@@ -250,11 +250,16 @@ acpi_physical_address __init acpi_os_get_root_pointer(void)
                               "System description tables not found\n");
                        return 0;
                }
-       } else
-               return acpi_find_rsdp();
+       } else {
+               acpi_physical_address pa = 0;
+
+               acpi_find_root_pointer(&pa);
+               return pa;
+       }
 }
 
-void __iomem *acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
+void __iomem *__init_refok
+acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
 {
        if (phys > ULONG_MAX) {
                printk(KERN_ERR PREFIX "Cannot map memory that high\n");
@@ -332,7 +337,15 @@ acpi_os_table_override(struct acpi_table_header * existing_table,
 
 static irqreturn_t acpi_irq(int irq, void *dev_id)
 {
-       return (*acpi_irq_handler) (acpi_irq_context) ? IRQ_HANDLED : IRQ_NONE;
+       u32 handled;
+
+       handled = (*acpi_irq_handler) (acpi_irq_context);
+
+       if (handled) {
+               acpi_irq_handled++;
+               return IRQ_HANDLED;
+       } else
+               return IRQ_NONE;
 }
 
 acpi_status
@@ -341,6 +354,8 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler,
 {
        unsigned int irq;
 
+       acpi_irq_stats_init();
+
        /*
         * Ignore the GSI from the core, and use the value in our copy of the
         * FADT. It may not be the same if an interrupt source override exists
@@ -661,25 +676,6 @@ static void acpi_os_execute_deferred(struct work_struct *work)
        dpc->function(dpc->context);
        kfree(dpc);
 
-       /* Yield cpu to notify thread */
-       cond_resched();
-
-       return;
-}
-
-static void acpi_os_execute_notify(struct work_struct *work)
-{
-       struct acpi_os_dpc *dpc = container_of(work, struct acpi_os_dpc, work);
-
-       if (!dpc) {
-               printk(KERN_ERR PREFIX "Invalid (NULL) context\n");
-               return;
-       }
-
-       dpc->function(dpc->context);
-
-       kfree(dpc);
-
        return;
 }
 
@@ -703,7 +699,7 @@ acpi_status acpi_os_execute(acpi_execute_type type,
 {
        acpi_status status = AE_OK;
        struct acpi_os_dpc *dpc;
-
+       struct workqueue_struct *queue;
        ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
                          "Scheduling function [%p(%p)] for deferred execution.\n",
                          function, context));
@@ -727,20 +723,13 @@ acpi_status acpi_os_execute(acpi_execute_type type,
        dpc->function = function;
        dpc->context = context;
 
-       if (type == OSL_NOTIFY_HANDLER) {
-               INIT_WORK(&dpc->work, acpi_os_execute_notify);
-               if (!queue_work(kacpi_notify_wq, &dpc->work)) {
-                       status = AE_ERROR;
-                       kfree(dpc);
-               }
-       } else {
-               INIT_WORK(&dpc->work, acpi_os_execute_deferred);
-               if (!queue_work(kacpid_wq, &dpc->work)) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Call to queue_work() failed.\n"));
-                       status = AE_ERROR;
-                       kfree(dpc);
-               }
+       INIT_WORK(&dpc->work, acpi_os_execute_deferred);
+       queue = (type == OSL_NOTIFY_HANDLER) ? kacpi_notify_wq : kacpid_wq;
+       if (!queue_work(queue, &dpc->work)) {
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+                         "Call to queue_work() failed.\n"));
+               status = AE_ERROR;
+               kfree(dpc);
        }
        return_ACPI_STATUS(status);
 }
@@ -1213,7 +1202,7 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object)
  *
  *     Returns 0 on success
  */
-int acpi_dmi_dump(void)
+static int acpi_dmi_dump(void)
 {
 
        if (!dmi_available)