linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / acpi / container.c
index 871aa52..b69a8ca 100644 (file)
@@ -73,16 +73,17 @@ static int is_device_present(acpi_handle handle)
        acpi_status status;
        unsigned long sta;
 
+       ACPI_FUNCTION_TRACE("is_device_present");
 
        status = acpi_get_handle(handle, "_STA", &temp);
        if (ACPI_FAILURE(status))
-               return 1;       /* _STA not found, assmue device present */
+               return_VALUE(1);        /* _STA not found, assmue device present */
 
        status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
        if (ACPI_FAILURE(status))
-               return 0;       /* Firmware error */
+               return_VALUE(0);        /* Firmware error */
 
-       return ((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT);
+       return_VALUE((sta & ACPI_STA_PRESENT) == ACPI_STA_PRESENT);
 }
 
 /*******************************************************************/
@@ -90,15 +91,16 @@ static int acpi_container_add(struct acpi_device *device)
 {
        struct acpi_container *container;
 
+       ACPI_FUNCTION_TRACE("acpi_container_add");
 
        if (!device) {
-               printk(KERN_ERR PREFIX "device is NULL\n");
-               return -EINVAL;
+               ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "device is NULL\n"));
+               return_VALUE(-EINVAL);
        }
 
        container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL);
        if (!container)
-               return -ENOMEM;
+               return_VALUE(-ENOMEM);
 
        memset(container, 0, sizeof(struct acpi_container));
        container->handle = device->handle;
@@ -109,7 +111,7 @@ static int acpi_container_add(struct acpi_device *device)
        ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n",
                          acpi_device_name(device), acpi_device_bid(device)));
 
-       return 0;
+       return_VALUE(0);
 }
 
 static int acpi_container_remove(struct acpi_device *device, int type)
@@ -128,22 +130,23 @@ static int container_device_add(struct acpi_device **device, acpi_handle handle)
        struct acpi_device *pdev;
        int result;
 
+       ACPI_FUNCTION_TRACE("container_device_add");
 
        if (acpi_get_parent(handle, &phandle)) {
-               return -ENODEV;
+               return_VALUE(-ENODEV);
        }
 
        if (acpi_bus_get_device(phandle, &pdev)) {
-               return -ENODEV;
+               return_VALUE(-ENODEV);
        }
 
        if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) {
-               return -ENODEV;
+               return_VALUE(-ENODEV);
        }
 
        result = acpi_bus_start(*device);
 
-       return result;
+       return_VALUE(result);
 }
 
 static void container_notify_cb(acpi_handle handle, u32 type, void *context)
@@ -153,6 +156,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
        int present;
        acpi_status status;
 
+       ACPI_FUNCTION_TRACE("container_notify_cb");
 
        present = is_device_present(handle);
 
@@ -188,7 +192,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
        default:
                break;
        }
-       return;
+       return_VOID;
 }
 
 static acpi_status
@@ -201,10 +205,11 @@ container_walk_namespace_cb(acpi_handle handle,
        acpi_status status;
        int *action = context;
 
+       ACPI_FUNCTION_TRACE("container_walk_namespace_cb");
 
        status = acpi_get_object_info(handle, &buffer);
        if (ACPI_FAILURE(status) || !buffer.pointer) {
-               return AE_OK;
+               return_ACPI_STATUS(AE_OK);
        }
 
        info = buffer.pointer;
@@ -236,9 +241,9 @@ container_walk_namespace_cb(acpi_handle handle,
        }
 
       end:
-       kfree(buffer.pointer);
+       acpi_os_free(buffer.pointer);
 
-       return AE_OK;
+       return_ACPI_STATUS(AE_OK);
 }
 
 static int __init acpi_container_init(void)
@@ -264,6 +269,7 @@ static void __exit acpi_container_exit(void)
 {
        int action = UNINSTALL_NOTIFY_HANDLER;
 
+       ACPI_FUNCTION_TRACE("acpi_container_exit");
 
        acpi_walk_namespace(ACPI_TYPE_DEVICE,
                            ACPI_ROOT_OBJECT,
@@ -272,7 +278,7 @@ static void __exit acpi_container_exit(void)
 
        acpi_bus_unregister_driver(&acpi_container_driver);
 
-       return;
+       return_VOID;
 }
 
 module_init(acpi_container_init);