patch-2.1.23 linux/drivers/char/msbusmouse.c

Next file: linux/drivers/char/n_tty.c
Previous file: linux/drivers/char/misc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.22/linux/drivers/char/msbusmouse.c linux/drivers/char/msbusmouse.c
@@ -40,6 +40,7 @@
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
 #include <linux/random.h>
+#include <linux/poll.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -155,13 +156,11 @@
 	return i;	
 }
 
-static int mouse_select(struct inode *inode, struct file *file, int sel_type, select_table * wait)
+static unsigned int mouse_poll(struct file *file, poll_table * wait)
 {
-	if (sel_type != SEL_IN)
-		return 0;
+	poll_wait(&mouse.wait, wait);
 	if (mouse.ready) 
-		return 1;
-	select_wait(&mouse.wait,wait);
+		return POLLIN | POLLRDNORM;
 	return 0;
 }
 
@@ -170,7 +169,7 @@
 	read_mouse,
 	write_mouse,
 	NULL, 		/* mouse_readdir */
-	mouse_select, 	/* mouse_select */
+	mouse_poll, 	/* mouse_poll */
 	NULL, 		/* mouse_ioctl */
 	NULL,		/* mouse_mmap */
 	open_mouse,

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov