ChangeSet 1.1938.505.19, 2005/03/02 14:06:18-05:00, [EMAIL PROTECTED]

        [ACPI] fix ACPI container driver's notify handler.
        
        Previously, the handler tried to make a container device be offline if 
an
        ACPI_NOTIFY_BUS/DEVICE_CHECK notification is performed on the device was
        present and has its acpi_device.  But, the condition is weird.  Whenever
        the notification is performed, there should be only the following two
        conditions:
        
          1. the device is present, but does not have its acpi_device.
          2. the device is not present, but has its acpi_device.
        
        #1 is a hot-addition case, which was handled properly also in previous
        handler.  #2 is a surprising hot-removal case, which was not handled in
        previous handler.
        
        Signed-off-by: Keiichiro Tokunaga <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Len Brown <[EMAIL PROTECTED]>



 container.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)


diff -Nru a/drivers/acpi/container.c b/drivers/acpi/container.c
--- a/drivers/acpi/container.c  2005-04-01 08:11:05 -08:00
+++ b/drivers/acpi/container.c  2005-04-01 08:11:05 -08:00
@@ -177,13 +177,18 @@
                printk("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);
                if (present) {
-                       status = acpi_bus_get_device(handle, &device);
                        if (ACPI_FAILURE(status) || !device) {
                                result = container_device_add(&device, handle);
                                if (!result)
-                                       kobject_hotplug(&device->kobj, 
KOBJ_ONLINE);
-                       } else {
+                                       kobject_hotplug(&device->kobj,
+                                                       KOBJ_ONLINE);
+                               else
+                                       printk("Failed to add container\n");
+                       }
+               } else {
+                       if (ACPI_SUCCESS(status)) {
                                /* device exist and this is a remove request */
                                kobject_hotplug(&device->kobj, KOBJ_OFFLINE);
                        }
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to