patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / drivers / acpi / scan.c
index e386f28..8f3557b 100644 (file)
@@ -4,7 +4,6 @@
 
 #include <linux/init.h>
 #include <linux/acpi.h>
-#include <linux/module.h>
 
 #include <acpi/acpi_drivers.h>
 #include <acpi/acinterp.h>     /* for acpi_ex_eisa_id_to_string() */
@@ -16,12 +15,6 @@ ACPI_MODULE_NAME             ("scan")
 #define STRUCT_TO_INT(s)       (*((int*)&s))
 
 extern struct acpi_device              *acpi_root;
-struct acpi_device             *acpi_fixed_pwr_button;
-struct acpi_device             *acpi_fixed_sleep_button;
-
-EXPORT_SYMBOL(acpi_fixed_pwr_button);
-EXPORT_SYMBOL(acpi_fixed_sleep_button);
-
 
 
 #define ACPI_BUS_CLASS                 "system_bus"
@@ -318,8 +311,10 @@ static int acpi_driver_detach(struct acpi_driver * drv)
                struct acpi_device * dev = container_of(node,struct acpi_device,g_list);
 
                if (dev->driver == drv) {
+                       spin_unlock(&acpi_device_lock);
                        if (drv->ops.remove)
                                drv->ops.remove(dev,ACPI_BUS_REMOVAL_NORMAL);
+                       spin_lock(&acpi_device_lock);
                        dev->driver = NULL;
                        dev->driver_data = NULL;
                        atomic_dec(&drv->references);
@@ -907,13 +902,10 @@ acpi_bus_scan_fixed (
        struct acpi_device      *root)
 {
        int                     result = 0;
+       struct acpi_device      *device = NULL;
 
        ACPI_FUNCTION_TRACE("acpi_bus_scan_fixed");
 
-       acpi_fixed_pwr_button = NULL;
-       acpi_fixed_sleep_button = NULL;
-
-
        if (!root)
                return_VALUE(-ENODEV);
 
@@ -921,11 +913,11 @@ acpi_bus_scan_fixed (
         * Enumerate all fixed-feature devices.
         */
        if (acpi_fadt.pwr_button == 0)
-               result = acpi_bus_add(&acpi_fixed_pwr_button, acpi_root, 
+               result = acpi_bus_add(&device, acpi_root, 
                        NULL, ACPI_BUS_TYPE_POWER_BUTTON);
 
        if (acpi_fadt.sleep_button == 0)
-               result = acpi_bus_add(&acpi_fixed_sleep_button, acpi_root, 
+               result = acpi_bus_add(&device, acpi_root, 
                        NULL, ACPI_BUS_TYPE_SLEEP_BUTTON);
 
        return_VALUE(result);