patch-2.3.31 linux/drivers/char/joystick/joy-amiga.c
Next file: linux/drivers/char/joystick/joy-analog.c
Previous file: linux/drivers/char/joystick/Makefile
Back to the patch index
Back to the overall index
- Lines: 63
- Date:
Tue Dec 7 10:13:11 1999
- Orig file:
v2.3.30/linux/drivers/char/joystick/joy-amiga.c
- Orig date:
Sun Nov 7 16:37:34 1999
diff -u --recursive --new-file v2.3.30/linux/drivers/char/joystick/joy-amiga.c linux/drivers/char/joystick/joy-amiga.c
@@ -1,7 +1,9 @@
/*
* joy-amiga.c Version 1.2
*
- * Copyright (c) 1998 Vojtech Pavlik
+ * Copyright (c) 1998-1999 Vojtech Pavlik
+ *
+ * Sponsored by SuSE
*/
/*
@@ -36,13 +38,14 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <asm/amigahw.h>
+#include <linux/init.h>
static struct js_port* js_am_port __initdata = NULL;
MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
MODULE_PARM(js_am, "1-2i");
-static int js_am[]={0,0};
+static int __initdata js_am[] = { 0, 0 };
/*
* js_am_read() reads and Amiga joystick data.
@@ -69,7 +72,7 @@
axes[0][0] = ((data >> 1) & 1) - ((data >> 9) & 1);
data = ~(data ^ (data << 1));
- axes[0][0] = ((data >> 1) & 1) - ((data >> 9) & 1);
+ axes[0][1] = ((data >> 1) & 1) - ((data >> 9) & 1);
return 0;
}
@@ -114,11 +117,14 @@
}
#ifndef MODULE
-void __init js_am_setup(char *str, int *ints)
+int __init js_am_setup(SETUP_PARAM)
{
int i;
+ SETUP_PARSE(2);
for (i = 0; i <= ints[0] && i < 2; i++) js_am[i] = ints[i+1];
+ return 1;
}
+__setup("js_am=", js_am_setup);
#endif
#ifdef MODULE
@@ -148,8 +154,8 @@
#ifdef MODULE
void cleanup_module(void)
{
- while (js_am_port != NULL) {
- if (js_am_port->devs[0] != NULL)
+ while (js_am_port) {
+ if (js_am_port->devs[0])
js_unregister_device(js_am_port->devs[0]);
js_am_port = js_unregister_port(js_am_port);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)