浏览代码

Input: amijoy - add missing platform check

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>
Geert Uytterhoeven 13 年之前
父节点
当前提交
3183968cbf
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/input/joystick/amijoy.c

+ 3 - 0
drivers/input/joystick/amijoy.c

@@ -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;