patch-2.1.23 linux/drivers/sbus/char/sunmouse.c

Next file: linux/drivers/scsi/ChangeLog
Previous file: linux/drivers/sbus/char/sunkbd.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.22/linux/drivers/sbus/char/sunmouse.c linux/drivers/sbus/char/sunmouse.c
@@ -45,6 +45,7 @@
 #include <linux/errno.h>
 #include <linux/miscdevice.h>
 #include <linux/mm.h>
+#include <linux/poll.h>
 #include <linux/init.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -346,15 +347,11 @@
 	return 0;
 }
 
-static int
-sun_mouse_select(struct inode *inode, struct file *file, int sel_type,
-			    select_table *wait)
+static unsigned int sun_mouse_poll(struct file *file, poll_table *wait)
 {
-	if(sel_type != SEL_IN)
-		return 0;
+	poll_wait(&sunmouse.proc_list, wait);
 	if(sunmouse.ready)
-		return 1;
-	select_wait(&sunmouse.proc_list, wait);
+		return POLLIN | POLLRDNORM;
 	return 0;
 }
 int
@@ -400,7 +397,7 @@
 	sun_mouse_read,
 	sun_mouse_write,
 	NULL,
-	sun_mouse_select,
+	sun_mouse_poll,
 	sun_mouse_ioctl,
 	NULL,
 	sun_mouse_open,

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