Input: xpad - fix clash of presence handling with LED setting
authorPavel Rojtberg <rojtberg@gmail.com>
Mon, 19 Oct 2015 07:06:58 +0000 (00:06 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 19 Oct 2015 07:11:22 +0000 (00:11 -0700)
Do not call xpad_identify_controller at init with wireless devices: it
conflicts with the already sent presence packet and will be called by
xpad360w_process_packet as needed anyway.

Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/joystick/xpad.c

index d382d48d675037ded04f113fc79de7af1183dcbc..fd4100d56d8c5509986be23e40d2af137cd840b1 100644 (file)
@@ -1001,8 +1001,15 @@ static int xpad_led_probe(struct usb_xpad *xpad)
        if (error)
                goto err_free_id;
 
-       /* Light up the segment corresponding to controller number */
-       xpad_identify_controller(xpad);
+       if (xpad->xtype == XTYPE_XBOX360) {
+               /*
+                * Light up the segment corresponding to controller
+                * number on wired devices. On wireless we'll do that
+                * when they respond to "presence" packet.
+                */
+               xpad_identify_controller(xpad);
+       }
+
        return 0;
 
 err_free_id: