]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
Input: amijoy - add missing platform check
authorGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 26 Mar 2012 06:29:30 +0000 (23:29 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 26 Mar 2012 06:33:23 +0000 (23:33 -0700)
On multi-platform kernels, the Amiga joystick driver may be initialized
when running on Amiga only. Else it may crash later.
Fortunately this driver is almost always compiled as a module (to avoid
conflicts with the mouse driver), so it needs an explicit insmod to
trigger a crash.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/joystick/amijoy.c

index 0bc86204213e187106c54c560774884ac632f09d..3aa93bf60ae352222396ebc47ada23c23968cb01 100644 (file)
@@ -108,6 +108,9 @@ static int __init amijoy_init(void)
        int i, j;
        int err;
 
+       if (!MACH_IS_AMIGA)
+               return -ENODEV;
+
        for (i = 0; i < 2; i++) {
                if (!amijoy[i])
                        continue;