ACPI: identify device tree root by null parent pointer, not ACPI_BUS_TYPE
[safe/jmp/linux-2.6] / drivers / acpi / container.c
index 17020c1..642bb30 100644 (file)
@@ -35,6 +35,8 @@
 #include <acpi/acpi_drivers.h>
 #include <acpi/container.h>
 
+#define PREFIX "ACPI: "
+
 #define ACPI_CONTAINER_DEVICE_NAME     "ACPI container device"
 #define ACPI_CONTAINER_CLASS           "container"
 
@@ -163,7 +165,7 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
        case ACPI_NOTIFY_BUS_CHECK:
                /* Fall through */
        case ACPI_NOTIFY_DEVICE_CHECK:
-               printk("Container driver received %s event\n",
+               printk(KERN_WARNING "Container driver received %s event\n",
                       (type == ACPI_NOTIFY_BUS_CHECK) ?
                       "ACPI_NOTIFY_BUS_CHECK" : "ACPI_NOTIFY_DEVICE_CHECK");
                status = acpi_bus_get_device(handle, &device);
@@ -174,7 +176,8 @@ static void container_notify_cb(acpi_handle handle, u32 type, void *context)
                                        kobject_uevent(&device->dev.kobj,
                                                       KOBJ_ONLINE);
                                else
-                                       printk("Failed to add container\n");
+                                       printk(KERN_WARNING
+                                              "Failed to add container\n");
                        }
                } else {
                        if (ACPI_SUCCESS(status)) {
@@ -199,20 +202,17 @@ container_walk_namespace_cb(acpi_handle handle,
                            u32 lvl, void *context, void **rv)
 {
        char *hid = NULL;
-       struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
        struct acpi_device_info *info;
        acpi_status status;
        int *action = context;
 
-
-       status = acpi_get_object_info(handle, &buffer);
-       if (ACPI_FAILURE(status) || !buffer.pointer) {
+       status = acpi_get_object_info(handle, &info);
+       if (ACPI_FAILURE(status)) {
                return AE_OK;
        }
 
-       info = buffer.pointer;
        if (info->valid & ACPI_VALID_HID)
-               hid = info->hardware_id.value;
+               hid = info->hardware_id.string;
 
        if (hid == NULL) {
                goto end;
@@ -239,7 +239,7 @@ container_walk_namespace_cb(acpi_handle handle,
        }
 
       end:
-       kfree(buffer.pointer);
+       kfree(info);
 
        return AE_OK;
 }