]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/dock.c
Merge branch 'linus' into x86/doc
[linux-2.6-omap-h63xx.git] / drivers / acpi / dock.c
index 1e872e79db33bdeaf35cdf4fd049afc0e31acd14..7d2edf143f1660f387a486829ce40b548bc96eaf 100644 (file)
@@ -563,9 +563,6 @@ EXPORT_SYMBOL_GPL(unregister_hotplug_dock_device);
  */
 static int handle_eject_request(struct dock_station *ds, u32 event)
 {
-       if (!dock_present(ds))
-               return -ENODEV;
-
        if (dock_in_progress(ds))
                return -EBUSY;
 
@@ -573,8 +570,16 @@ static int handle_eject_request(struct dock_station *ds, u32 event)
         * here we need to generate the undock
         * event prior to actually doing the undock
         * so that the device struct still exists.
+        * Also, even send the dock event if the
+        * device is not present anymore
         */
        dock_event(ds, event, UNDOCK_EVENT);
+
+       if (!dock_present(ds)) {
+               complete_undock(ds);
+               return -ENODEV;
+       }
+
        hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST);
        undock(ds);
        eject_dock(ds);
@@ -917,9 +922,6 @@ static int __init dock_init(void)
 
        dock_station = NULL;
 
-       if (acpi_disabled)
-               return 0;
-
        if (acpi_disabled)
                return 0;