Revert "ARM: tegra: tegratab: dummy change"
[linux-2.6.git] / drivers / acpi / acpica / nsdump.c
index 2deb986..3f7f3f6 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2008, Intel Corp.
+ * Copyright (C) 2000 - 2012, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -180,7 +180,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
                return (AE_OK);
        }
 
-       this_node = acpi_ns_map_handle_to_node(obj_handle);
+       this_node = acpi_ns_validate_handle(obj_handle);
        if (!this_node) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Invalid object handle %p\n",
                                  obj_handle));
@@ -205,8 +205,8 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
                /* Check the node type and name */
 
                if (type > ACPI_TYPE_LOCAL_MAX) {
-                       ACPI_WARNING((AE_INFO, "Invalid ACPI Object Type %08X",
-                                     type));
+                       ACPI_WARNING((AE_INFO,
+                                     "Invalid ACPI Object Type 0x%08X", type));
                }
 
                if (!acpi_ut_valid_acpi_name(this_node->name.integer)) {
@@ -242,7 +242,20 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
 
                if (!obj_desc) {
 
-                       /* No attached object, we are done */
+                       /* No attached object. Some types should always have an object */
+
+                       switch (type) {
+                       case ACPI_TYPE_INTEGER:
+                       case ACPI_TYPE_PACKAGE:
+                       case ACPI_TYPE_BUFFER:
+                       case ACPI_TYPE_STRING:
+                       case ACPI_TYPE_METHOD:
+                               acpi_os_printf("<No attached object>");
+                               break;
+
+                       default:
+                               break;
+                       }
 
                        acpi_os_printf("\n");
                        return (AE_OK);
@@ -441,7 +454,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
                        return (AE_OK);
                }
 
-               acpi_os_printf("(R%d)", obj_desc->common.reference_count);
+               acpi_os_printf("(R%u)", obj_desc->common.reference_count);
 
                switch (type) {
                case ACPI_TYPE_METHOD:
@@ -624,9 +637,22 @@ acpi_ns_dump_objects(acpi_object_type type,
                     acpi_owner_id owner_id, acpi_handle start_handle)
 {
        struct acpi_walk_info info;
+       acpi_status status;
 
        ACPI_FUNCTION_ENTRY();
 
+       /*
+        * Just lock the entire namespace for the duration of the dump.
+        * We don't want any changes to the namespace during this time,
+        * especially the temporary nodes since we are going to display
+        * them also.
+        */
+       status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+       if (ACPI_FAILURE(status)) {
+               acpi_os_printf("Could not acquire namespace mutex\n");
+               return;
+       }
+
        info.debug_level = ACPI_LV_TABLES;
        info.owner_id = owner_id;
        info.display_type = display_type;
@@ -636,6 +662,8 @@ acpi_ns_dump_objects(acpi_object_type type,
                                     ACPI_NS_WALK_TEMP_NODES,
                                     acpi_ns_dump_one_object, NULL,
                                     (void *)&info, NULL);
+
+       (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
 }
 #endif                         /* ACPI_FUTURE_USAGE */