Pull novell-bugzilla-156426 into release branch
[pandora-kernel.git] / drivers / acpi / events / evxface.c
index 43b33d1..76c34a6 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2005, R. Byron Moore
+ * Copyright (C) 2000 - 2006, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
-#include <linux/module.h>
-
 #include <acpi/acpi.h>
 #include <acpi/acnamesp.h>
 #include <acpi/acevents.h>
@@ -68,7 +66,7 @@ acpi_status acpi_install_exception_handler(acpi_exception_handler handler)
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("acpi_install_exception_handler");
+       ACPI_FUNCTION_TRACE(acpi_install_exception_handler);
 
        status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
        if (ACPI_FAILURE(status)) {
@@ -90,6 +88,8 @@ acpi_status acpi_install_exception_handler(acpi_exception_handler handler)
        (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
        return_ACPI_STATUS(status);
 }
+
+ACPI_EXPORT_SYMBOL(acpi_install_exception_handler)
 #endif                         /*  ACPI_FUTURE_USAGE  */
 
 /*******************************************************************************
@@ -107,14 +107,13 @@ acpi_status acpi_install_exception_handler(acpi_exception_handler handler)
  *              event.
  *
  ******************************************************************************/
-
 acpi_status
 acpi_install_fixed_event_handler(u32 event,
                                 acpi_event_handler handler, void *context)
 {
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("acpi_install_fixed_event_handler");
+       ACPI_FUNCTION_TRACE(acpi_install_fixed_event_handler);
 
        /* Parameter validation */
 
@@ -143,8 +142,8 @@ acpi_install_fixed_event_handler(u32 event,
        if (ACPI_SUCCESS(status))
                status = acpi_enable_event(event, 0);
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                 "Could not enable fixed event.\n"));
+               ACPI_WARNING((AE_INFO, "Could not enable fixed event %X",
+                             event));
 
                /* Remove the handler */
 
@@ -161,7 +160,7 @@ acpi_install_fixed_event_handler(u32 event,
        return_ACPI_STATUS(status);
 }
 
-EXPORT_SYMBOL(acpi_install_fixed_event_handler);
+ACPI_EXPORT_SYMBOL(acpi_install_fixed_event_handler)
 
 /*******************************************************************************
  *
@@ -175,13 +174,12 @@ EXPORT_SYMBOL(acpi_install_fixed_event_handler);
  * DESCRIPTION: Disables the event and unregisters the event handler.
  *
  ******************************************************************************/
-
 acpi_status
 acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
 {
        acpi_status status = AE_OK;
 
-       ACPI_FUNCTION_TRACE("acpi_remove_fixed_event_handler");
+       ACPI_FUNCTION_TRACE(acpi_remove_fixed_event_handler);
 
        /* Parameter validation */
 
@@ -204,10 +202,11 @@ acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
        acpi_gbl_fixed_event_handlers[event].context = NULL;
 
        if (ACPI_FAILURE(status)) {
-               ACPI_DEBUG_PRINT((ACPI_DB_WARN,
-                                 "Could not write to fixed event enable register.\n"));
+               ACPI_WARNING((AE_INFO,
+                             "Could not write to fixed event enable register %X",
+                             event));
        } else {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X.\n",
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n",
                                  event));
        }
 
@@ -215,7 +214,7 @@ acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
        return_ACPI_STATUS(status);
 }
 
-EXPORT_SYMBOL(acpi_remove_fixed_event_handler);
+ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler)
 
 /*******************************************************************************
  *
@@ -234,7 +233,6 @@ EXPORT_SYMBOL(acpi_remove_fixed_event_handler);
  * DESCRIPTION: Install a handler for notifies on an ACPI device
  *
  ******************************************************************************/
-
 acpi_status
 acpi_install_notify_handler(acpi_handle device,
                            u32 handler_type,
@@ -245,7 +243,7 @@ acpi_install_notify_handler(acpi_handle device,
        struct acpi_namespace_node *node;
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("acpi_install_notify_handler");
+       ACPI_FUNCTION_TRACE(acpi_install_notify_handler);
 
        /* Parameter validation */
 
@@ -274,6 +272,7 @@ acpi_install_notify_handler(acpi_handle device,
         * only one <external> global handler can be regsitered (per notify type).
         */
        if (device == ACPI_ROOT_OBJECT) {
+
                /* Make sure the handler is not already installed */
 
                if (((handler_type & ACPI_SYSTEM_NOTIFY) &&
@@ -316,6 +315,7 @@ acpi_install_notify_handler(acpi_handle device,
 
                obj_desc = acpi_ns_get_attached_object(node);
                if (obj_desc) {
+
                        /* Object exists - make sure there's no handler */
 
                        if (((handler_type & ACPI_SYSTEM_NOTIFY) &&
@@ -369,6 +369,7 @@ acpi_install_notify_handler(acpi_handle device,
                }
 
                if (handler_type == ACPI_ALL_NOTIFY) {
+
                        /* Extra ref if installed in both */
 
                        acpi_ut_add_reference(notify_obj);
@@ -380,7 +381,7 @@ acpi_install_notify_handler(acpi_handle device,
        return_ACPI_STATUS(status);
 }
 
-EXPORT_SYMBOL(acpi_install_notify_handler);
+ACPI_EXPORT_SYMBOL(acpi_install_notify_handler)
 
 /*******************************************************************************
  *
@@ -398,7 +399,6 @@ EXPORT_SYMBOL(acpi_install_notify_handler);
  * DESCRIPTION: Remove a handler for notifies on an ACPI device
  *
  ******************************************************************************/
-
 acpi_status
 acpi_remove_notify_handler(acpi_handle device,
                           u32 handler_type, acpi_notify_handler handler)
@@ -408,7 +408,7 @@ acpi_remove_notify_handler(acpi_handle device,
        struct acpi_namespace_node *node;
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE("acpi_remove_notify_handler");
+       ACPI_FUNCTION_TRACE(acpi_remove_notify_handler);
 
        /* Parameter validation */
 
@@ -434,7 +434,7 @@ acpi_remove_notify_handler(acpi_handle device,
 
        if (device == ACPI_ROOT_OBJECT) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                                 "Removing notify handler for ROOT object.\n"));
+                                 "Removing notify handler for namespace root object\n"));
 
                if (((handler_type & ACPI_SYSTEM_NOTIFY) &&
                     !acpi_gbl_system_notify.handler) ||
@@ -534,7 +534,7 @@ acpi_remove_notify_handler(acpi_handle device,
        return_ACPI_STATUS(status);
 }
 
-EXPORT_SYMBOL(acpi_remove_notify_handler);
+ACPI_EXPORT_SYMBOL(acpi_remove_notify_handler)
 
 /*******************************************************************************
  *
@@ -553,7 +553,6 @@ EXPORT_SYMBOL(acpi_remove_notify_handler);
  * DESCRIPTION: Install a handler for a General Purpose Event.
  *
  ******************************************************************************/
-
 acpi_status
 acpi_install_gpe_handler(acpi_handle gpe_device,
                         u32 gpe_number,
@@ -562,9 +561,9 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
        struct acpi_gpe_event_info *gpe_event_info;
        struct acpi_handler_info *handler;
        acpi_status status;
-       u32 flags;
+       acpi_cpu_flags flags;
 
-       ACPI_FUNCTION_TRACE("acpi_install_gpe_handler");
+       ACPI_FUNCTION_TRACE(acpi_install_gpe_handler);
 
        /* Parameter validation */
 
@@ -595,7 +594,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
 
        /* Allocate and init handler object */
 
-       handler = ACPI_MEM_CALLOCATE(sizeof(struct acpi_handler_info));
+       handler = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_handler_info));
        if (!handler) {
                status = AE_NO_MEMORY;
                goto unlock_and_exit;
@@ -629,7 +628,7 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
        return_ACPI_STATUS(status);
 }
 
-EXPORT_SYMBOL(acpi_install_gpe_handler);
+ACPI_EXPORT_SYMBOL(acpi_install_gpe_handler)
 
 /*******************************************************************************
  *
@@ -645,7 +644,6 @@ EXPORT_SYMBOL(acpi_install_gpe_handler);
  * DESCRIPTION: Remove a handler for a General Purpose acpi_event.
  *
  ******************************************************************************/
-
 acpi_status
 acpi_remove_gpe_handler(acpi_handle gpe_device,
                        u32 gpe_number, acpi_event_handler address)
@@ -653,9 +651,9 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
        struct acpi_gpe_event_info *gpe_event_info;
        struct acpi_handler_info *handler;
        acpi_status status;
-       u32 flags;
+       acpi_cpu_flags flags;
 
-       ACPI_FUNCTION_TRACE("acpi_remove_gpe_handler");
+       ACPI_FUNCTION_TRACE(acpi_remove_gpe_handler);
 
        /* Parameter validation */
 
@@ -723,14 +721,14 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
 
        /* Now we can free the handler object */
 
-       ACPI_MEM_FREE(handler);
+       ACPI_FREE(handler);
 
       unlock_and_exit:
        (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);
        return_ACPI_STATUS(status);
 }
 
-EXPORT_SYMBOL(acpi_remove_gpe_handler);
+ACPI_EXPORT_SYMBOL(acpi_remove_gpe_handler)
 
 /*******************************************************************************
  *
@@ -745,7 +743,6 @@ EXPORT_SYMBOL(acpi_remove_gpe_handler);
  * DESCRIPTION: Acquire the ACPI Global Lock
  *
  ******************************************************************************/
-
 acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
 {
        acpi_status status;
@@ -770,7 +767,7 @@ acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle)
        return (status);
 }
 
-EXPORT_SYMBOL(acpi_acquire_global_lock);
+ACPI_EXPORT_SYMBOL(acpi_acquire_global_lock)
 
 /*******************************************************************************
  *
@@ -783,7 +780,6 @@ EXPORT_SYMBOL(acpi_acquire_global_lock);
  * DESCRIPTION: Release the ACPI Global Lock. The handle must be valid.
  *
  ******************************************************************************/
-
 acpi_status acpi_release_global_lock(u32 handle)
 {
        acpi_status status;
@@ -796,4 +792,4 @@ acpi_status acpi_release_global_lock(u32 handle)
        return (status);
 }
 
-EXPORT_SYMBOL(acpi_release_global_lock);
+ACPI_EXPORT_SYMBOL(acpi_release_global_lock)