]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/namespace/nsxfobj.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / acpi / namespace / nsxfobj.c
index 9c5f3302799ce984953411f0f2c39a90ce5af89a..faa3758872012c9a208ec82a0a757f8e82092365 100644 (file)
@@ -6,7 +6,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2006, R. Byron Moore
+ * Copyright (C) 2000 - 2007, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * POSSIBILITY OF SUCH DAMAGES.
  */
 
-#include <linux/module.h>
-
 #include <acpi/acpi.h>
 #include <acpi/acnamesp.h>
 
 #define _COMPONENT          ACPI_NAMESPACE
 ACPI_MODULE_NAME("nsxfobj")
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_get_id
+ *
+ * PARAMETERS:  Handle          - Handle of object whose id is desired
+ *              ret_id          - Where the id will be placed
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: This routine returns the owner id associated with a handle
+ *
+ ******************************************************************************/
+acpi_status acpi_get_id(acpi_handle handle, acpi_owner_id * ret_id)
+{
+       struct acpi_namespace_node *node;
+       acpi_status status;
+
+       /* Parameter Validation */
+
+       if (!ret_id) {
+               return (AE_BAD_PARAMETER);
+       }
+
+       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);
+       if (!node) {
+               (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
+               return (AE_BAD_PARAMETER);
+       }
+
+       *ret_id = node->owner_id;
+
+       status = acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
+       return (status);
+}
+
+ACPI_EXPORT_SYMBOL(acpi_get_id)
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_get_type
@@ -101,7 +143,7 @@ acpi_status acpi_get_type(acpi_handle handle, acpi_object_type * ret_type)
        return (status);
 }
 
-EXPORT_SYMBOL(acpi_get_type);
+ACPI_EXPORT_SYMBOL(acpi_get_type)
 
 /*******************************************************************************
  *
@@ -116,7 +158,6 @@ EXPORT_SYMBOL(acpi_get_type);
  *              Handle.
  *
  ******************************************************************************/
-
 acpi_status acpi_get_parent(acpi_handle handle, acpi_handle * ret_handle)
 {
        struct acpi_namespace_node *node;
@@ -162,7 +203,7 @@ acpi_status acpi_get_parent(acpi_handle handle, acpi_handle * ret_handle)
        return (status);
 }
 
-EXPORT_SYMBOL(acpi_get_parent);
+ACPI_EXPORT_SYMBOL(acpi_get_parent)
 
 /*******************************************************************************
  *
@@ -181,7 +222,6 @@ EXPORT_SYMBOL(acpi_get_parent);
  *              Scope is returned.
  *
  ******************************************************************************/
-
 acpi_status
 acpi_get_next_object(acpi_object_type type,
                     acpi_handle parent,
@@ -243,4 +283,4 @@ acpi_get_next_object(acpi_object_type type,
        return (status);
 }
 
-EXPORT_SYMBOL(acpi_get_next_object);
+ACPI_EXPORT_SYMBOL(acpi_get_next_object)