Input: wacom_w8001 - simplify w8001_remove
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 24 Aug 2011 05:57:00 +0000 (22:57 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 24 Aug 2011 06:07:51 +0000 (23:07 -0700)
Since touchscreen driver does not handle any events to be sent to the
device we can close serio port first and then unregister the input device.

Tested-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/wacom_w8001.c

index 5ece6c1f329699290b27b0521850659e6b127655..1f42d91f755b390adbefd8bdd2630f183b714dc0 100644 (file)
@@ -499,12 +499,12 @@ static void w8001_disconnect(struct serio *serio)
 {
        struct w8001 *w8001 = serio_get_drvdata(serio);
 
-       input_get_device(w8001->dev);
-       input_unregister_device(w8001->dev);
        serio_close(serio);
-       serio_set_drvdata(serio, NULL);
-       input_put_device(w8001->dev);
+
+       input_unregister_device(w8001->dev);
        kfree(w8001);
+
+       serio_set_drvdata(serio, NULL);
 }
 
 /*