]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/namespace/nsaccess.c
Pull trivial into release branch
[linux-2.6-omap-h63xx.git] / drivers / acpi / namespace / nsaccess.c
index edfbe34600f5178b66b9ec39f18c768eee2b1dfd..48fadade52e2b17bbd55777fd30204bb2168548d 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
@@ -70,7 +70,7 @@ acpi_status acpi_ns_root_initialize(void)
        union acpi_operand_object *obj_desc;
        acpi_string val = NULL;
 
-       ACPI_FUNCTION_TRACE("ns_root_initialize");
+       ACPI_FUNCTION_TRACE(ns_root_initialize);
 
        status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
        if (ACPI_FAILURE(status)) {
@@ -98,6 +98,7 @@ acpi_status acpi_ns_root_initialize(void)
                          "Entering predefined entries into namespace\n"));
 
        for (init_val = acpi_gbl_pre_defined_names; init_val->name; init_val++) {
+
                /* _OSI is optional for now, will be permanent later */
 
                if (!ACPI_STRCMP(init_val->name, "_OSI")
@@ -110,10 +111,9 @@ acpi_status acpi_ns_root_initialize(void)
                                        ACPI_NS_NO_UPSEARCH, NULL, &new_node);
 
                if (ACPI_FAILURE(status) || (!new_node)) {      /* Must be on same line for code converter */
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                         "Could not create predefined name %s, %s\n",
-                                         init_val->name,
-                                         acpi_format_exception(status)));
+                       ACPI_EXCEPTION((AE_INFO, status,
+                                       "Could not create predefined name %s",
+                                       init_val->name));
                }
 
                /*
@@ -124,9 +124,9 @@ acpi_status acpi_ns_root_initialize(void)
                if (init_val->val) {
                        status = acpi_os_predefined_override(init_val, &val);
                        if (ACPI_FAILURE(status)) {
-                               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                                 "Could not override predefined %s\n",
-                                                 init_val->name));
+                               ACPI_ERROR((AE_INFO,
+                                           "Could not override predefined %s",
+                                           init_val->name));
                        }
 
                        if (!val) {
@@ -157,7 +157,7 @@ acpi_status acpi_ns_root_initialize(void)
 
 #if defined (ACPI_ASL_COMPILER)
 
-                               /* save the parameter count for the i_aSL compiler */
+                               /* Save the parameter count for the i_aSL compiler */
 
                                new_node->value = obj_desc->method.param_count;
 #else
@@ -233,7 +233,9 @@ acpi_status acpi_ns_root_initialize(void)
 
                        default:
 
-                               ACPI_REPORT_ERROR(("Unsupported initial type value %X\n", init_val->type));
+                               ACPI_ERROR((AE_INFO,
+                                           "Unsupported initial type value %X",
+                                           init_val->type));
                                acpi_ut_remove_reference(obj_desc);
                                obj_desc = NULL;
                                continue;
@@ -257,10 +259,8 @@ acpi_status acpi_ns_root_initialize(void)
        /* Save a handle to "_GPE", it is always present */
 
        if (ACPI_SUCCESS(status)) {
-               status =
-                   acpi_ns_get_node_by_path("\\_GPE", NULL,
-                                            ACPI_NS_NO_UPSEARCH,
-                                            &acpi_gbl_fadt_gpe_device);
+               status = acpi_ns_get_node(NULL, "\\_GPE", ACPI_NS_NO_UPSEARCH,
+                                         &acpi_gbl_fadt_gpe_device);
        }
 
        return_ACPI_STATUS(status);
@@ -309,17 +309,17 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
        acpi_object_type type_to_check_for;
        acpi_object_type this_search_type;
        u32 search_parent_flag = ACPI_NS_SEARCH_PARENT;
-       u32 local_flags = flags & ~(ACPI_NS_ERROR_IF_FOUND |
-                                   ACPI_NS_SEARCH_PARENT);
+       u32 local_flags;
 
-       ACPI_FUNCTION_TRACE("ns_lookup");
+       ACPI_FUNCTION_TRACE(ns_lookup);
 
        if (!return_node) {
                return_ACPI_STATUS(AE_BAD_PARAMETER);
        }
 
-       acpi_gbl_ns_lookup_count++;
+       local_flags = flags & ~(ACPI_NS_ERROR_IF_FOUND | ACPI_NS_SEARCH_PARENT);
        *return_node = ACPI_ENTRY_NOT_FOUND;
+       acpi_gbl_ns_lookup_count++;
 
        if (!acpi_gbl_root_node) {
                return_ACPI_STATUS(AE_NO_NAMESPACE);
@@ -339,18 +339,23 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                prefix_node = scope_info->scope.node;
                if (ACPI_GET_DESCRIPTOR_TYPE(prefix_node) !=
                    ACPI_DESC_TYPE_NAMED) {
-                       ACPI_REPORT_ERROR(("ns_lookup: %p is not a namespace node [%s]\n", prefix_node, acpi_ut_get_descriptor_name(prefix_node)));
+                       ACPI_ERROR((AE_INFO, "%p is not a namespace node [%s]",
+                                   prefix_node,
+                                   acpi_ut_get_descriptor_name(prefix_node)));
                        return_ACPI_STATUS(AE_AML_INTERNAL);
                }
 
-               /*
-                * This node might not be a actual "scope" node (such as a
-                * Device/Method, etc.)  It could be a Package or other object node.
-                * Backup up the tree to find the containing scope node.
-                */
-               while (!acpi_ns_opens_scope(prefix_node->type) &&
-                      prefix_node->type != ACPI_TYPE_ANY) {
-                       prefix_node = acpi_ns_get_parent_node(prefix_node);
+               if (!(flags & ACPI_NS_PREFIX_IS_SCOPE)) {
+                       /*
+                        * This node might not be a actual "scope" node (such as a
+                        * Device/Method, etc.)  It could be a Package or other object node.
+                        * Backup up the tree to find the containing scope node.
+                        */
+                       while (!acpi_ns_opens_scope(prefix_node->type) &&
+                              prefix_node->type != ACPI_TYPE_ANY) {
+                               prefix_node =
+                                   acpi_ns_get_parent_node(prefix_node);
+                       }
                }
        }
 
@@ -362,6 +367,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
         * Begin examination of the actual pathname
         */
        if (!pathname) {
+
                /* A Null name_path is allowed and refers to the root */
 
                num_segments = 0;
@@ -386,6 +392,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                 * to the current scope).
                 */
                if (*path == (u8) AML_ROOT_PREFIX) {
+
                        /* Pathname is fully qualified, start from the root */
 
                        this_node = acpi_gbl_root_node;
@@ -413,6 +420,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                        this_node = prefix_node;
                        num_carats = 0;
                        while (*path == (u8) AML_PARENT_PREFIX) {
+
                                /* Name is fully qualified, no search rules apply */
 
                                search_parent_flag = ACPI_NS_NO_UPSEARCH;
@@ -427,9 +435,11 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                                num_carats++;
                                this_node = acpi_ns_get_parent_node(this_node);
                                if (!this_node) {
+
                                        /* Current scope has no parent scope */
 
-                                       ACPI_REPORT_ERROR(("ACPI path has too many parent prefixes (^) - reached beyond root node\n"));
+                                       ACPI_ERROR((AE_INFO,
+                                                   "ACPI path has too many parent prefixes (^) - reached beyond root node"));
                                        return_ACPI_STATUS(AE_NOT_FOUND);
                                }
                        }
@@ -498,7 +508,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                        path++;
 
                        ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
-                                         "Multi Pathname (%d Segments, Flags=%X) \n",
+                                         "Multi Pathname (%d Segments, Flags=%X)\n",
                                          num_segments, flags));
                        break;
 
@@ -565,6 +575,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                                             &this_node);
                if (ACPI_FAILURE(status)) {
                        if (status == AE_NOT_FOUND) {
+
                                /* Name not found in ACPI namespace */
 
                                ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
@@ -598,9 +609,15 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                    (type_to_check_for != ACPI_TYPE_LOCAL_SCOPE) &&
                    (this_node->type != ACPI_TYPE_ANY) &&
                    (this_node->type != type_to_check_for)) {
+
                        /* Complain about a type mismatch */
 
-                       ACPI_REPORT_WARNING(("ns_lookup: Type mismatch on %4.4s (%s), searching for (%s)\n", (char *)&simple_name, acpi_ut_get_type_name(this_node->type), acpi_ut_get_type_name(type_to_check_for)));
+                       ACPI_WARNING((AE_INFO,
+                                     "NsLookup: Type mismatch on %4.4s (%s), searching for (%s)",
+                                     ACPI_CAST_PTR(char, &simple_name),
+                                     acpi_ut_get_type_name(this_node->type),
+                                     acpi_ut_get_type_name
+                                     (type_to_check_for)));
                }
 
                /*