]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
ACPICA: Update internal namespace node/handle interfaces
authorBob Moore <robert.moore@intel.com>
Fri, 11 Dec 2009 06:57:00 +0000 (14:57 +0800)
committerLen Brown <len.brown@intel.com>
Tue, 15 Dec 2009 22:29:35 +0000 (17:29 -0500)
This change deletes the unnecessary acpi_ns_convert_entry_to_handle
interface and renames the acpi_ns_map_handle_to_node interface to
acpi_ns_validate_handle.  ACPICA BZ 798.

http://www.acpica.org/bugzilla/show_bug.cgi?id=798

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
12 files changed:
drivers/acpi/acpica/acnamesp.h
drivers/acpi/acpica/evregion.c
drivers/acpi/acpica/evxface.c
drivers/acpi/acpica/evxfevnt.c
drivers/acpi/acpica/evxfregn.c
drivers/acpi/acpica/nsdump.c
drivers/acpi/acpica/nsnames.c
drivers/acpi/acpica/nsutils.c
drivers/acpi/acpica/nsxfeval.c
drivers/acpi/acpica/nsxfname.c
drivers/acpi/acpica/nsxfobj.c
drivers/acpi/acpica/rsxface.c

index ab83919dda61d78b9fb42b182347111a20ae1da6..14cef45bd6c48dc37599a6d8738e998fb0ae7819 100644 (file)
@@ -354,9 +354,7 @@ acpi_ns_externalize_name(u32 internal_name_length,
                         const char *internal_name,
                         u32 * converted_name_length, char **converted_name);
 
-struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle);
-
-acpi_handle acpi_ns_convert_entry_to_handle(struct acpi_namespace_node *node);
+struct acpi_namespace_node *acpi_ns_validate_handle(acpi_handle handle);
 
 void acpi_ns_terminate(void);
 
index 0bc807c33a568b712cbb1ea27b4c37ca65ec772c..5336d911fbf07c7f6240d72a6691c766c9c1d5ad 100644 (file)
@@ -718,7 +718,7 @@ acpi_ev_install_handler(acpi_handle obj_handle,
 
        /* Convert and validate the device handle */
 
-       node = acpi_ns_map_handle_to_node(obj_handle);
+       node = acpi_ns_validate_handle(obj_handle);
        if (!node) {
                return (AE_BAD_PARAMETER);
        }
@@ -1087,7 +1087,7 @@ acpi_ev_reg_run(acpi_handle obj_handle,
 
        /* Convert and validate the device handle */
 
-       node = acpi_ns_map_handle_to_node(obj_handle);
+       node = acpi_ns_validate_handle(obj_handle);
        if (!node) {
                return (AE_BAD_PARAMETER);
        }
index 10b8543dd466e593b3d5f589af22cc7041843a24..2fe0809d4eb298162c99171073dcfa0162327b59 100644 (file)
@@ -259,7 +259,7 @@ acpi_install_notify_handler(acpi_handle device,
 
        /* Convert and validate the device handle */
 
-       node = acpi_ns_map_handle_to_node(device);
+       node = acpi_ns_validate_handle(device);
        if (!node) {
                status = AE_BAD_PARAMETER;
                goto unlock_and_exit;
@@ -425,7 +425,7 @@ acpi_remove_notify_handler(acpi_handle device,
 
        /* Convert and validate the device handle */
 
-       node = acpi_ns_map_handle_to_node(device);
+       node = acpi_ns_validate_handle(device);
        if (!node) {
                status = AE_BAD_PARAMETER;
                goto unlock_and_exit;
index 4721f58fe42c0653d6a6c14aee384ffbab2e708a..eed7a38d25f2cfdb2be2c5c712da9f8b4d6df5f8 100644 (file)
@@ -610,7 +610,7 @@ acpi_install_gpe_block(acpi_handle gpe_device,
                return (status);
        }
 
-       node = acpi_ns_map_handle_to_node(gpe_device);
+       node = acpi_ns_validate_handle(gpe_device);
        if (!node) {
                status = AE_BAD_PARAMETER;
                goto unlock_and_exit;
@@ -698,7 +698,7 @@ acpi_status acpi_remove_gpe_block(acpi_handle gpe_device)
                return (status);
        }
 
-       node = acpi_ns_map_handle_to_node(gpe_device);
+       node = acpi_ns_validate_handle(gpe_device);
        if (!node) {
                status = AE_BAD_PARAMETER;
                goto unlock_and_exit;
index 7c3d2d356ffba4877227cc2c340b7d3d1d62dc9c..c98aa7c2d67c6bbc492e9c842ce8270814e8b0a8 100644 (file)
@@ -89,7 +89,7 @@ acpi_install_address_space_handler(acpi_handle device,
 
        /* Convert and validate the device handle */
 
-       node = acpi_ns_map_handle_to_node(device);
+       node = acpi_ns_validate_handle(device);
        if (!node) {
                status = AE_BAD_PARAMETER;
                goto unlock_and_exit;
@@ -155,7 +155,7 @@ acpi_remove_address_space_handler(acpi_handle device,
 
        /* Convert and validate the device handle */
 
-       node = acpi_ns_map_handle_to_node(device);
+       node = acpi_ns_validate_handle(device);
        if (!node ||
            ((node->type != ACPI_TYPE_DEVICE) &&
             (node->type != ACPI_TYPE_PROCESSOR) &&
index 2deb986861ca2d9ca9d376f92d737954200f5968..e37836e27e29eb3a2816696fbfb7c5da43b04999 100644 (file)
@@ -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));
index af8e6bcee07e5544112299df765c540a7b4c0602..8f9a4875ce26708ae06b17a5f637b43a52964537 100644 (file)
@@ -232,7 +232,7 @@ acpi_ns_handle_to_pathname(acpi_handle target_handle,
 
        ACPI_FUNCTION_TRACE_PTR(ns_handle_to_pathname, target_handle);
 
-       node = acpi_ns_map_handle_to_node(target_handle);
+       node = acpi_ns_validate_handle(target_handle);
        if (!node) {
                return_ACPI_STATUS(AE_BAD_PARAMETER);
        }
index ea55ab4f984924937feca72f00cb056d02bc1993..47d91e668a1bfc25436a0993b3e04b3397aed490 100644 (file)
@@ -671,24 +671,25 @@ acpi_ns_externalize_name(u32 internal_name_length,
 
 /*******************************************************************************
  *
- * FUNCTION:    acpi_ns_map_handle_to_node
+ * FUNCTION:    acpi_ns_validate_handle
  *
- * PARAMETERS:  Handle          - Handle to be converted to an Node
+ * PARAMETERS:  Handle          - Handle to be validated and typecast to a
+ *                                namespace node.
  *
- * RETURN:      A Name table entry pointer
+ * RETURN:      A pointer to a namespace node
  *
- * DESCRIPTION: Convert a namespace handle to a real Node
+ * DESCRIPTION: Convert a namespace handle to a namespace node. Handles special
+ *              cases for the root node.
  *
- * Note: Real integer handles would allow for more verification
+ * NOTE: Real integer handles would allow for more verification
  *       and keep all pointers within this subsystem - however this introduces
- *       more (and perhaps unnecessary) overhead.
- *
- * The current implemenation is basically a placeholder until such time comes
- * that it is needed.
+ *       more overhead and has not been necessary to this point. Drivers
+ *       holding handles are typically notified before a node becomes invalid
+ *       due to a table unload.
  *
  ******************************************************************************/
 
-struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle)
+struct acpi_namespace_node *acpi_ns_validate_handle(acpi_handle handle)
 {
 
        ACPI_FUNCTION_ENTRY();
@@ -708,42 +709,6 @@ struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle)
        return (ACPI_CAST_PTR(struct acpi_namespace_node, handle));
 }
 
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ns_convert_entry_to_handle
- *
- * PARAMETERS:  Node          - Node to be converted to a Handle
- *
- * RETURN:      A user handle
- *
- * DESCRIPTION: Convert a real Node to a namespace handle
- *
- ******************************************************************************/
-
-acpi_handle acpi_ns_convert_entry_to_handle(struct acpi_namespace_node *node)
-{
-
-       /*
-        * Simple implementation for now;
-        */
-       return ((acpi_handle) node);
-
-/* Example future implementation ---------------------
-
-       if (!Node)
-       {
-               return (NULL);
-       }
-
-       if (Node == acpi_gbl_root_node)
-       {
-               return (ACPI_ROOT_OBJECT);
-       }
-
-       return ((acpi_handle) Node);
-------------------------------------------------------*/
-}
-
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ns_terminate
index f2bd1da770018dbab1da0b872d9b138abcdab268..f0c0892bc7e5c6babc8d46955d46d1d93f24bd82 100644 (file)
@@ -190,7 +190,7 @@ acpi_evaluate_object(acpi_handle handle,
 
        /* Convert and validate the device handle */
 
-       info->prefix_node = acpi_ns_map_handle_to_node(handle);
+       info->prefix_node = acpi_ns_validate_handle(handle);
        if (!info->prefix_node) {
                status = AE_BAD_PARAMETER;
                goto cleanup;
@@ -552,7 +552,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
                return (status);
        }
 
-       node = acpi_ns_map_handle_to_node(obj_handle);
+       node = acpi_ns_validate_handle(obj_handle);
        status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
        if (ACPI_FAILURE(status)) {
                return (status);
@@ -729,7 +729,7 @@ acpi_attach_data(acpi_handle obj_handle,
 
        /* Convert and validate the handle */
 
-       node = acpi_ns_map_handle_to_node(obj_handle);
+       node = acpi_ns_validate_handle(obj_handle);
        if (!node) {
                status = AE_BAD_PARAMETER;
                goto unlock_and_exit;
@@ -775,7 +775,7 @@ acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler)
 
        /* Convert and validate the handle */
 
-       node = acpi_ns_map_handle_to_node(obj_handle);
+       node = acpi_ns_validate_handle(obj_handle);
        if (!node) {
                status = AE_BAD_PARAMETER;
                goto unlock_and_exit;
@@ -822,7 +822,7 @@ acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data)
 
        /* Convert and validate the handle */
 
-       node = acpi_ns_map_handle_to_node(obj_handle);
+       node = acpi_ns_validate_handle(obj_handle);
        if (!node) {
                status = AE_BAD_PARAMETER;
                goto unlock_and_exit;
index ddc84af6336e727d5eaa1ec4799e4c38e49a9333..e611dd961b200ba6f8afd6cebe23b282efe503f7 100644 (file)
@@ -93,7 +93,7 @@ acpi_get_handle(acpi_handle parent,
        /* Convert a parent handle to a prefix node */
 
        if (parent) {
-               prefix_node = acpi_ns_map_handle_to_node(parent);
+               prefix_node = acpi_ns_validate_handle(parent);
                if (!prefix_node) {
                        return (AE_BAD_PARAMETER);
                }
@@ -114,7 +114,7 @@ acpi_get_handle(acpi_handle parent,
 
                if (!ACPI_STRCMP(pathname, ACPI_NS_ROOT_PATH)) {
                        *ret_handle =
-                           acpi_ns_convert_entry_to_handle(acpi_gbl_root_node);
+                           ACPI_CAST_PTR(acpi_handle, acpi_gbl_root_node);
                        return (AE_OK);
                }
        } else if (!prefix_node) {
@@ -129,7 +129,7 @@ acpi_get_handle(acpi_handle parent,
        status =
            acpi_ns_get_node(prefix_node, pathname, ACPI_NS_NO_UPSEARCH, &node);
        if (ACPI_SUCCESS(status)) {
-               *ret_handle = acpi_ns_convert_entry_to_handle(node);
+               *ret_handle = ACPI_CAST_PTR(acpi_handle, node);
        }
 
        return (status);
@@ -186,7 +186,7 @@ acpi_get_name(acpi_handle handle, u32 name_type, struct acpi_buffer * buffer)
                return (status);
        }
 
-       node = acpi_ns_map_handle_to_node(handle);
+       node = acpi_ns_validate_handle(handle);
        if (!node) {
                status = AE_BAD_PARAMETER;
                goto unlock_and_exit;
@@ -291,7 +291,7 @@ acpi_get_object_info(acpi_handle handle,
                goto cleanup;
        }
 
-       node = acpi_ns_map_handle_to_node(handle);
+       node = acpi_ns_validate_handle(handle);
        if (!node) {
                (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
                return (AE_BAD_PARAMETER);
index 4071bad4458ed7d229bc04e30cb02abcb8efe26b..0cc6ba01a49543c27eb669fdf662f8db31a587d5 100644 (file)
@@ -79,7 +79,7 @@ acpi_status acpi_get_id(acpi_handle handle, acpi_owner_id * ret_id)
 
        /* Convert and validate the handle */
 
-       node = acpi_ns_map_handle_to_node(handle);
+       node = acpi_ns_validate_handle(handle);
        if (!node) {
                (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
                return (AE_BAD_PARAMETER);
@@ -132,7 +132,7 @@ acpi_status acpi_get_type(acpi_handle handle, acpi_object_type * ret_type)
 
        /* Convert and validate the handle */
 
-       node = acpi_ns_map_handle_to_node(handle);
+       node = acpi_ns_validate_handle(handle);
        if (!node) {
                (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
                return (AE_BAD_PARAMETER);
@@ -182,7 +182,7 @@ acpi_status acpi_get_parent(acpi_handle handle, acpi_handle * ret_handle)
 
        /* Convert and validate the handle */
 
-       node = acpi_ns_map_handle_to_node(handle);
+       node = acpi_ns_validate_handle(handle);
        if (!node) {
                status = AE_BAD_PARAMETER;
                goto unlock_and_exit;
@@ -191,7 +191,7 @@ acpi_status acpi_get_parent(acpi_handle handle, acpi_handle * ret_handle)
        /* Get the parent entry */
 
        parent_node = acpi_ns_get_parent_node(node);
-       *ret_handle = acpi_ns_convert_entry_to_handle(parent_node);
+       *ret_handle = ACPI_CAST_PTR(acpi_handle, parent_node);
 
        /* Return exception if parent is null */
 
@@ -251,7 +251,7 @@ acpi_get_next_object(acpi_object_type type,
 
                /* Start search at the beginning of the specified scope */
 
-               parent_node = acpi_ns_map_handle_to_node(parent);
+               parent_node = acpi_ns_validate_handle(parent);
                if (!parent_node) {
                        status = AE_BAD_PARAMETER;
                        goto unlock_and_exit;
@@ -260,7 +260,7 @@ acpi_get_next_object(acpi_object_type type,
                /* Non-null handle, ignore the parent */
                /* Convert and validate the handle */
 
-               child_node = acpi_ns_map_handle_to_node(child);
+               child_node = acpi_ns_validate_handle(child);
                if (!child_node) {
                        status = AE_BAD_PARAMETER;
                        goto unlock_and_exit;
@@ -276,7 +276,7 @@ acpi_get_next_object(acpi_object_type type,
        }
 
        if (ret_handle) {
-               *ret_handle = acpi_ns_convert_entry_to_handle(node);
+               *ret_handle = ACPI_CAST_PTR(acpi_handle, node);
        }
 
       unlock_and_exit:
index 395212bcd19b470d756efa5328dfc9d21464c603..f27feb4772f6306b10a3a897f3f2759f5fa8c237 100644 (file)
@@ -104,7 +104,7 @@ acpi_rs_validate_parameters(acpi_handle device_handle,
                return_ACPI_STATUS(AE_BAD_PARAMETER);
        }
 
-       node = acpi_ns_map_handle_to_node(device_handle);
+       node = acpi_ns_validate_handle(device_handle);
        if (!node) {
                return_ACPI_STATUS(AE_BAD_PARAMETER);
        }