Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / acpi / namespace / nsxfobj.c
index 19acf32..a033259 100644 (file)
@@ -6,7 +6,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
 #include <acpi/acpi.h>
 #include <acpi/acnamesp.h>
 
-
 #define _COMPONENT          ACPI_NAMESPACE
-        ACPI_MODULE_NAME    ("nsxfobj")
+ACPI_MODULE_NAME("nsxfobj")
 
 /*******************************************************************************
  *
  * FUNCTION:    acpi_get_type
  *
  * PARAMETERS:  Handle          - Handle of object whose type is desired
- *              *ret_type       - Where the type will be placed
+ *              ret_type        - Where the type will be placed
  *
  * RETURN:      Status
  *
  * DESCRIPTION: This routine returns the type associatd with a particular handle
  *
  ******************************************************************************/
-
-acpi_status
-acpi_get_type (
-       acpi_handle                     handle,
-       acpi_object_type                *ret_type)
+acpi_status acpi_get_type(acpi_handle handle, acpi_object_type * ret_type)
 {
-       struct acpi_namespace_node      *node;
-       acpi_status                     status;
-
+       struct acpi_namespace_node *node;
+       acpi_status status;
 
        /* Parameter Validation */
 
@@ -88,27 +82,26 @@ acpi_get_type (
                return (AE_OK);
        }
 
-       status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
-       if (ACPI_FAILURE (status)) {
+       status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+       if (ACPI_FAILURE(status)) {
                return (status);
        }
 
        /* Convert and validate the handle */
 
-       node = acpi_ns_map_handle_to_node (handle);
+       node = acpi_ns_map_handle_to_node(handle);
        if (!node) {
-               (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
+               (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
                return (AE_BAD_PARAMETER);
        }
 
        *ret_type = node->type;
 
-
-       status = acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
+       status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
        return (status);
 }
-EXPORT_SYMBOL(acpi_get_type);
 
+EXPORT_SYMBOL(acpi_get_type);
 
 /*******************************************************************************
  *
@@ -124,14 +117,10 @@ EXPORT_SYMBOL(acpi_get_type);
  *
  ******************************************************************************/
 
-acpi_status
-acpi_get_parent (
-       acpi_handle                     handle,
-       acpi_handle                     *ret_handle)
+acpi_status acpi_get_parent(acpi_handle handle, acpi_handle * ret_handle)
 {
-       struct acpi_namespace_node      *node;
-       acpi_status                     status;
-
+       struct acpi_namespace_node *node;
+       acpi_status status;
 
        if (!ret_handle) {
                return (AE_BAD_PARAMETER);
@@ -143,14 +132,14 @@ acpi_get_parent (
                return (AE_NULL_ENTRY);
        }
 
-       status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
-       if (ACPI_FAILURE (status)) {
+       status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+       if (ACPI_FAILURE(status)) {
                return (status);
        }
 
        /* Convert and validate the handle */
 
-       node = acpi_ns_map_handle_to_node (handle);
+       node = acpi_ns_map_handle_to_node(handle);
        if (!node) {
                status = AE_BAD_PARAMETER;
                goto unlock_and_exit;
@@ -159,22 +148,21 @@ acpi_get_parent (
        /* Get the parent entry */
 
        *ret_handle =
-               acpi_ns_convert_entry_to_handle (acpi_ns_get_parent_node (node));
+           acpi_ns_convert_entry_to_handle(acpi_ns_get_parent_node(node));
 
        /* Return exception if parent is null */
 
-       if (!acpi_ns_get_parent_node (node)) {
+       if (!acpi_ns_get_parent_node(node)) {
                status = AE_NULL_ENTRY;
        }
 
+      unlock_and_exit:
 
-unlock_and_exit:
-
-       (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
+       (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
        return (status);
 }
-EXPORT_SYMBOL(acpi_get_parent);
 
+EXPORT_SYMBOL(acpi_get_parent);
 
 /*******************************************************************************
  *
@@ -195,17 +183,14 @@ EXPORT_SYMBOL(acpi_get_parent);
  ******************************************************************************/
 
 acpi_status
-acpi_get_next_object (
-       acpi_object_type                type,
-       acpi_handle                     parent,
-       acpi_handle                     child,
-       acpi_handle                     *ret_handle)
+acpi_get_next_object(acpi_object_type type,
+                    acpi_handle parent,
+                    acpi_handle child, acpi_handle * ret_handle)
 {
-       acpi_status                     status;
-       struct acpi_namespace_node      *node;
-       struct acpi_namespace_node      *parent_node = NULL;
-       struct acpi_namespace_node      *child_node = NULL;
-
+       acpi_status status;
+       struct acpi_namespace_node *node;
+       struct acpi_namespace_node *parent_node = NULL;
+       struct acpi_namespace_node *child_node = NULL;
 
        /* Parameter validation */
 
@@ -213,8 +198,8 @@ acpi_get_next_object (
                return (AE_BAD_PARAMETER);
        }
 
-       status = acpi_ut_acquire_mutex (ACPI_MTX_NAMESPACE);
-       if (ACPI_FAILURE (status)) {
+       status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
+       if (ACPI_FAILURE(status)) {
                return (status);
        }
 
@@ -223,17 +208,16 @@ acpi_get_next_object (
        if (!child) {
                /* Start search at the beginning of the specified scope */
 
-               parent_node = acpi_ns_map_handle_to_node (parent);
+               parent_node = acpi_ns_map_handle_to_node(parent);
                if (!parent_node) {
                        status = AE_BAD_PARAMETER;
                        goto unlock_and_exit;
                }
-       }
-       else {
+       } else {
                /* Non-null handle, ignore the parent */
                /* Convert and validate the handle */
 
-               child_node = acpi_ns_map_handle_to_node (child);
+               child_node = acpi_ns_map_handle_to_node(child);
                if (!child_node) {
                        status = AE_BAD_PARAMETER;
                        goto unlock_and_exit;
@@ -242,21 +226,20 @@ acpi_get_next_object (
 
        /* Internal function does the real work */
 
-       node = acpi_ns_get_next_node (type, parent_node, child_node);
+       node = acpi_ns_get_next_node(type, parent_node, child_node);
        if (!node) {
                status = AE_NOT_FOUND;
                goto unlock_and_exit;
        }
 
        if (ret_handle) {
-               *ret_handle = acpi_ns_convert_entry_to_handle (node);
+               *ret_handle = acpi_ns_convert_entry_to_handle(node);
        }
 
+      unlock_and_exit:
 
-unlock_and_exit:
-
-       (void) acpi_ut_release_mutex (ACPI_MTX_NAMESPACE);
+       (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
        return (status);
 }
-EXPORT_SYMBOL(acpi_get_next_object);
 
+EXPORT_SYMBOL(acpi_get_next_object);