]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Input: iforce - remove "being used" silliness
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 25 Jul 2018 00:18:27 +0000 (17:18 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 23 Jun 2019 06:54:37 +0000 (23:54 -0700)
The kernel is supposed to handle multiple devices, static flags
in packet handling code will never work.

Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/joystick/iforce/iforce-packets.c

index c10169f4554ec8cddcd9439e0549af09ddc7c0b4..91893c751524a10dc7095c0bd03ae001b9b05d3d 100644 (file)
@@ -149,12 +149,6 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
 {
        struct input_dev *dev = iforce->dev;
        int i;
-       static int being_used = 0;
-
-       if (being_used)
-               dev_warn(&iforce->dev->dev,
-                        "re-entrant call to iforce_process %d\n", being_used);
-       being_used++;
 
 #ifdef CONFIG_JOYSTICK_IFORCE_232
        if (HI(iforce->expect_packet) == HI(cmd)) {
@@ -165,10 +159,8 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
 #endif
        wake_up(&iforce->wait);
 
-       if (!iforce->type) {
-               being_used--;
+       if (!iforce->type)
                return;
-       }
 
        switch (HI(cmd)) {
 
@@ -233,7 +225,6 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
                        }
                        break;
        }
-       being_used--;
 }
 
 int iforce_get_id_packet(struct iforce *iforce, char *packet)