Thread (2 messages) 2 messages, 2 authors, 2012-03-26

Re: [PATCH 08/11] input/amijoy: Add missing platform check

flat view

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2012-03-26 06:30:09
Also in: lkml

On Wed, Mar 21, 2012 at 10:51:52AM +0100, Geert Uytterhoeven wrote:
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>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Applied, thanks Geert.
quoted hunk ↗ jump to hunk
---
 drivers/input/joystick/amijoy.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c
index 0bc8620..3aa93bf 100644
--- a/drivers/input/joystick/amijoy.c
+++ b/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;
-- 
1.7.0.4
-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help