patch-2.3.22 linux/drivers/usb/mouse.c

Next file: linux/drivers/usb/ohci-hcd.c
Previous file: linux/drivers/usb/hp_scanner.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.21/linux/drivers/usb/mouse.c linux/drivers/usb/mouse.c
@@ -34,7 +34,6 @@
 #include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/errno.h>
-#include <linux/miscdevice.h>
 #include <linux/random.h>
 #include <linux/poll.h>
 #include <linux/init.h>
@@ -44,8 +43,6 @@
 
 #include "usb.h"
 
-#define USB_MOUSE_MINOR 32
-
 struct mouse_state {
 	unsigned char buttons; /* current button state */
 	long dx; /* dx, dy, dz are change since last read */
@@ -109,7 +106,7 @@
 
 	/* if the USB mouse sends an interrupt, then something noteworthy
 	   must have happened */
-	mouse->buttons = data[0] & 0x07;
+	mouse->buttons = data[0] & 0x0f;
 	mouse->dx += data[1]; /* data[] is signed, so this works */
 	mouse->dy -= data[2]; /* y-axis is reversed */
 	mouse->dz -= data[3];
@@ -319,10 +316,6 @@
 	fasync_mouse,
 };
 
-static struct miscdevice usb_mouse = {
-	USB_MOUSE_MINOR, "USB mouse", &usb_mouse_fops
-};
-
 static int mouse_probe(struct usb_device *dev)
 {
 	struct usb_interface_descriptor *interface;
@@ -416,7 +409,9 @@
 	"mouse",
 	mouse_probe,
 	mouse_disconnect,
-	{ NULL, NULL }
+	{ NULL, NULL },
+	&usb_mouse_fops,
+	16
 };
 
 int usb_mouse_init(void)
@@ -428,8 +423,6 @@
 	init_waitqueue_head(&mouse->wait);
 	mouse->fasync = NULL;
 
-	misc_register(&usb_mouse);
-
 	usb_register(&mouse_driver);
 	printk(KERN_INFO "USB HID boot protocol mouse driver registered.\n");
 	return 0;
@@ -449,7 +442,6 @@
 
 	/* this, too, probably needs work */
 	usb_deregister(&mouse_driver);
-	misc_deregister(&usb_mouse);
 }
 
 #ifdef MODULE

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)