Merge branch 'libertas' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
[powerpc.git] / drivers / input / joydev.c
index 9bcc542..10e3b7b 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/module.h>
 #include <linux/poll.h>
 #include <linux/init.h>
-#include <linux/smp_lock.h>
 #include <linux/device.h>
 
 MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
@@ -595,9 +594,9 @@ static void joydev_disconnect(struct input_handle *handle)
 
        if (joydev->open) {
                input_close_device(handle);
-               wake_up_interruptible(&joydev->wait);
                list_for_each_entry(client, &joydev->client_list, node)
                        kill_fasync(&client->fasync, SIGIO, POLL_HUP);
+               wake_up_interruptible(&joydev->wait);
        } else
                joydev_free(joydev);
 }