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>
This commit is contained in:
Dmitry Torokhov 2018-08-10 10:34:13 -07:00
parent 2880dcf9cf
commit 633354d191
2 changed files with 1 additions and 4 deletions

View File

@ -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 */

View File

@ -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);
}