Input: gamecon - reference correct pad in gc_psx_command()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 21 Jul 2010 03:25:35 +0000 (20:25 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 21 Jul 2010 03:29:32 +0000 (20:29 -0700)
Otherwise we won't see any events from the gamepad.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16408

Reported-and-tested-by: Eugene Yudin <eugene.yudin@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/joystick/gamecon.c

index a79f708441085c91e1304728c428363e21d17555..0ffaf2c77a19fa7715af800f43f5fe90ba215fc3 100644 (file)
@@ -578,7 +578,7 @@ static void gc_psx_command(struct gc *gc, int b, unsigned char *data)
                read = parport_read_status(port) ^ 0x80;
 
                for (j = 0; j < GC_MAX_DEVICES; j++) {
-                       struct gc_pad *pad = &gc->pads[i];
+                       struct gc_pad *pad = &gc->pads[j];
 
                        if (pad->type == GC_PSX || pad->type == GC_DDR)
                                data[j] |= (read & gc_status_bit[j]) ? (1 << i) : 0;