ACPICA: Update error/debug messages for fixed events
authorBob Moore <robert.moore@intel.com>
Fri, 8 Mar 2013 09:21:41 +0000 (09:21 +0000)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 11 Mar 2013 23:45:04 +0000 (00:45 +0100)
Add the actual fixed event name to all messages for clarity.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/evevent.c
drivers/acpi/acpica/evxface.c

index b8ea0b26cde33aea6a78f34a10e379d79a7d60fc..02219ffba8b67566ab7a186bc9acca4d6d40ae28 100644 (file)
@@ -257,6 +257,8 @@ u32 acpi_ev_fixed_event_detect(void)
  *
  * DESCRIPTION: Clears the status bit for the requested event, calls the
  *              handler that previously registered for the event.
+ *              NOTE: If there is no handler for the event, the event is
+ *              disabled to prevent futher interrupts.
  *
  ******************************************************************************/
 
@@ -271,17 +273,17 @@ static u32 acpi_ev_fixed_event_dispatch(u32 event)
                                      status_register_id, ACPI_CLEAR_STATUS);
 
        /*
-        * Make sure we've got a handler. If not, report an error. The event is
-        * disabled to prevent further interrupts.
+        * Make sure that a handler exists. If not, report an error
+        * and disable the event to prevent further interrupts.
         */
-       if (NULL == acpi_gbl_fixed_event_handlers[event].handler) {
+       if (!acpi_gbl_fixed_event_handlers[event].handler) {
                (void)acpi_write_bit_register(acpi_gbl_fixed_event_info[event].
                                              enable_register_id,
                                              ACPI_DISABLE_EVENT);
 
                ACPI_ERROR((AE_INFO,
-                           "No installed handler for fixed event [0x%08X]",
-                           event));
+                           "No installed handler for fixed event - %s (%u), disabling",
+                           acpi_ut_get_event_name(event), event));
 
                return (ACPI_INTERRUPT_NOT_HANDLED);
        }
index ddffd6847914d5544688a6e35b471e2826b8c20b..ca5fba99c33bc82a302f8eb246ca41224a2cbada 100644 (file)
@@ -467,9 +467,9 @@ acpi_install_fixed_event_handler(u32 event,
                return_ACPI_STATUS(status);
        }
 
-       /* Don't allow two handlers. */
+       /* Do not allow multiple handlers */
 
-       if (NULL != acpi_gbl_fixed_event_handlers[event].handler) {
+       if (acpi_gbl_fixed_event_handlers[event].handler) {
                status = AE_ALREADY_EXISTS;
                goto cleanup;
        }
@@ -483,8 +483,9 @@ acpi_install_fixed_event_handler(u32 event,
        if (ACPI_SUCCESS(status))
                status = acpi_enable_event(event, 0);
        if (ACPI_FAILURE(status)) {
-               ACPI_WARNING((AE_INFO, "Could not enable fixed event 0x%X",
-                             event));
+               ACPI_WARNING((AE_INFO,
+                             "Could not enable fixed event - %s (%u)",
+                             acpi_ut_get_event_name(event), event));
 
                /* Remove the handler */
 
@@ -492,7 +493,8 @@ acpi_install_fixed_event_handler(u32 event,
                acpi_gbl_fixed_event_handlers[event].context = NULL;
        } else {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
-                                 "Enabled fixed event %X, Handler=%p\n", event,
+                                 "Enabled fixed event %s (%X), Handler=%p\n",
+                                 acpi_ut_get_event_name(event), event,
                                  handler));
        }
 
@@ -544,11 +546,12 @@ acpi_remove_fixed_event_handler(u32 event, acpi_event_handler handler)
 
        if (ACPI_FAILURE(status)) {
                ACPI_WARNING((AE_INFO,
-                             "Could not write to fixed event enable register 0x%X",
-                             event));
+                             "Could not disable fixed event - %s (%u)",
+                             acpi_ut_get_event_name(event), event));
        } else {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Disabled fixed event %X\n",
-                                 event));
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+                                 "Disabled fixed event - %s (%X)\n",
+                                 acpi_ut_get_event_name(event), event));
        }
 
        (void)acpi_ut_release_mutex(ACPI_MTX_EVENTS);