diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-08-10 10:34:13 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-06-22 23:55:23 -0700 |
commit | 633354d1910262f2a3262797572ff72da461379e (patch) | |
tree | a52c034c247eb1efd754a0546a7995157a119f65 /drivers/input | |
parent | 2880dcf9cfc28a3803aee4c964743adbb66b0f1a (diff) | |
download | linux-633354d1910262f2a3262797572ff72da461379e.tar.gz linux-633354d1910262f2a3262797572ff72da461379e.tar.bz2 linux-633354d1910262f2a3262797572ff72da461379e.zip |
Input: iforce - only call iforce_process_packet() if initialized
It is excessive to check if device is fully initialized in
iforce_process_packet(), as for USB-conected devices we do not start
collecting reports until the device is fully initialized.
Let's change serio transport code to not call iforce_process_packet()
until device initialization is done.
Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/joystick/iforce/iforce-packets.c | 3 | ||||
-rw-r--r-- | drivers/input/joystick/iforce/iforce-serio.c | 2 |
2 files changed, 1 insertions, 4 deletions
diff --git a/drivers/input/joystick/iforce/iforce-packets.c b/drivers/input/joystick/iforce/iforce-packets.c index c0a665961c23..976ec1c7cf15 100644 --- a/drivers/input/joystick/iforce/iforce-packets.c +++ b/drivers/input/joystick/iforce/iforce-packets.c @@ -172,9 +172,6 @@ void iforce_process_packet(struct iforce *iforce, struct input_dev *dev = iforce->dev; int i, j; - if (!iforce->type) - return; - switch (packet_id) { case 0x01: /* joystick position data */ diff --git a/drivers/input/joystick/iforce/iforce-serio.c b/drivers/input/joystick/iforce/iforce-serio.c index 0dd95d145e85..8d7eba9c9f0e 100644 --- a/drivers/input/joystick/iforce/iforce-serio.c +++ b/drivers/input/joystick/iforce/iforce-serio.c @@ -172,7 +172,7 @@ static irqreturn_t iforce_serio_irq(struct serio *serio, /* Signal that command is done */ wake_up(&iforce->wait); - } else { + } else if (likely(iforce->type)) { iforce_process_packet(iforce, iforce_serio->id, iforce->data, iforce_serio->len); } |