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>
struct input_dev *dev = iforce->dev;
int i, j;
- if (!iforce->type)
- return;
-
switch (packet_id) {
case 0x01: /* joystick position data */
/* 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);
}