Input: penmount - simplify unregister procedure
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 13 Sep 2011 05:13:00 +0000 (22:13 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 21 Sep 2011 05:46:31 +0000 (22:46 -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: John Sung <penmount.touch@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/penmount.c

index 7fc556295c0e1e75e98090c6a05ac10c3ee212b2..4c012fb2b01eb091f764abea0ef992e8052a53d3 100644 (file)
@@ -183,12 +183,12 @@ static void pm_disconnect(struct serio *serio)
 {
        struct pm *pm = serio_get_drvdata(serio);
 
-       input_get_device(pm->dev);
-       input_unregister_device(pm->dev);
        serio_close(serio);
-       serio_set_drvdata(serio, NULL);
-       input_put_device(pm->dev);
+
+       input_unregister_device(pm->dev);
        kfree(pm);
+
+       serio_set_drvdata(serio, NULL);
 }
 
 /*