X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Facpi%2Fnamespace%2Fnsxfobj.c;h=a0332595677a9dbb51093443de445781ce43f1f8;hb=d8b3d7077d08311552643a220f21ce0d30130f59;hp=19acf32674b94e13872a6e0016f7c485ad2e9bda;hpb=207e0a826fdee4bfe853681aef2175a739c11286;p=linux-2.6.git diff --git a/drivers/acpi/namespace/nsxfobj.c b/drivers/acpi/namespace/nsxfobj.c index 19acf3267..a03325956 100644 --- a/drivers/acpi/namespace/nsxfobj.c +++ b/drivers/acpi/namespace/nsxfobj.c @@ -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 @@ -47,31 +47,25 @@ #include #include - #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);