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

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

diff -u --recursive --new-file v2.1.22/linux/drivers/char/atarimouse.c linux/drivers/char/atarimouse.c
@@ -19,6 +19,7 @@
 #include <linux/miscdevice.h>
 #include <linux/mm.h>
 #include <linux/random.h>
+#include <linux/poll.h>
 
 #include <asm/setup.h>
 #include <asm/atarikb.h>
@@ -130,13 +131,11 @@
     return r;
 }
 
-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) {
-	    	if (mouse.ready)
-			return 1;
-		select_wait(&mouse.wait, wait);
-	}
+	poll_wait(&mouse.wait, wait);
+	if (mouse.ready)
+		return POLLIN | POLLRDNORM;
 	return 0;
 }
 
@@ -145,7 +144,7 @@
     read_mouse,
     write_mouse,
     NULL,		/* mouse_readdir */
-    mouse_select,
+    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