Input: gamecon - reference correct input device in NES mode
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:11 +0000 (20:29 -0700)
We moved input devices from 'struct gc' to individial pads (struct
gc-pad), but gc_nes_process_packet() was still trying to use old
ones and crashing.

Cc: stable@kernel.org
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/joystick/gamecon.c

index fbd62abb66f9dc3017fc4f678dddd28cd889309e..a79f708441085c91e1304728c428363e21d17555 100644 (file)
@@ -89,7 +89,6 @@ struct gc_pad {
 struct gc {
        struct pardevice *pd;
        struct gc_pad pads[GC_MAX_DEVICES];
-       struct input_dev *dev[GC_MAX_DEVICES];
        struct timer_list timer;
        int pad_count[GC_MAX];
        int used;
@@ -387,7 +386,7 @@ static void gc_nes_process_packet(struct gc *gc)
        for (i = 0; i < GC_MAX_DEVICES; i++) {
 
                pad = &gc->pads[i];
-               dev = gc->dev[i];
+               dev = pad->dev;
                s = gc_status_bit[i];
 
                switch (pad->type) {