Merge ../linus
[pandora-kernel.git] / drivers / acpi / utilities / utalloc.c
index 3b29aec..7940fc1 100644 (file)
@@ -61,24 +61,6 @@ acpi_status acpi_ut_create_caches(void)
 {
        acpi_status status;
 
-#ifdef ACPI_DBG_TRACK_ALLOCATIONS
-
-       /* Memory allocation lists */
-
-       status = acpi_ut_create_list("Acpi-Global", 0, &acpi_gbl_global_list);
-       if (ACPI_FAILURE(status)) {
-               return (status);
-       }
-
-       status =
-           acpi_ut_create_list("Acpi-Namespace",
-                               sizeof(struct acpi_namespace_node),
-                               &acpi_gbl_ns_node_list);
-       if (ACPI_FAILURE(status)) {
-               return (status);
-       }
-#endif
-
        /* Object Caches, for frequently used objects */
 
        status =
@@ -108,7 +90,7 @@ acpi_status acpi_ut_create_caches(void)
        }
 
        status =
-           acpi_os_create_cache("Acpi-parse_ext",
+           acpi_os_create_cache("Acpi-ParseExt",
                                 sizeof(struct acpi_parse_obj_named),
                                 ACPI_MAX_EXTPARSE_CACHE_DEPTH,
                                 &acpi_gbl_ps_node_ext_cache);
@@ -125,6 +107,24 @@ acpi_status acpi_ut_create_caches(void)
                return (status);
        }
 
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+
+       /* Memory allocation lists */
+
+       status = acpi_ut_create_list("Acpi-Global", 0, &acpi_gbl_global_list);
+       if (ACPI_FAILURE(status)) {
+               return (status);
+       }
+
+       status =
+           acpi_ut_create_list("Acpi-Namespace",
+                               sizeof(struct acpi_namespace_node),
+                               &acpi_gbl_ns_node_list);
+       if (ACPI_FAILURE(status)) {
+               return (status);
+       }
+#endif
+
        return (AE_OK);
 }
 
@@ -158,6 +158,21 @@ acpi_status acpi_ut_delete_caches(void)
        (void)acpi_os_delete_cache(acpi_gbl_ps_node_ext_cache);
        acpi_gbl_ps_node_ext_cache = NULL;
 
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+
+       /* Debug only - display leftover memory allocation, if any */
+
+       acpi_ut_dump_allocations(ACPI_UINT32_MAX, NULL);
+
+       /* Free memory lists */
+
+       acpi_os_free(acpi_gbl_global_list);
+       acpi_gbl_global_list = NULL;
+
+       acpi_os_free(acpi_gbl_ns_node_list);
+       acpi_gbl_ns_node_list = NULL;
+#endif
+
        return (AE_OK);
 }
 
@@ -289,7 +304,7 @@ void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line)
 {
        void *allocation;
 
-       ACPI_FUNCTION_TRACE_U32("ut_allocate", size);
+       ACPI_FUNCTION_TRACE_U32(ut_allocate, size);
 
        /* Check for an inadvertent size of zero bytes */