patch-1.3.4 linux/drivers/char/psaux.c

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

diff -u --recursive --new-file v1.3.3/linux/drivers/char/psaux.c linux/drivers/char/psaux.c
@@ -140,7 +140,7 @@
 	while ((inb(AUX_STATUS) & AUX_OBUF_FULL) != AUX_OBUF_FULL
 	            && retries < MAX_RETRIES) {          /* wait for ack */
        		current->state = TASK_INTERRUPTIBLE;
-		current->timeout = jiffies + 5;
+		current->timeout = jiffies + (5*HZ + 99) / 100;
 		schedule();
 		retries++;
         }
@@ -232,7 +232,9 @@
 
 static void release_aux(struct inode * inode, struct file * file)
 {
+#ifndef __alpha__
 	aux_write_dev(AUX_DISABLE_DEV);		/* disable aux device */
+#endif
 	aux_write_cmd(AUX_INTS_OFF);		/* disable controller ints */
 	poll_aux_status();
 	outb_p(AUX_DISABLE,AUX_COMMAND);      	/* Disable Aux device */
@@ -342,7 +344,7 @@
 		outb_p(AUX_MAGIC_WRITE,AUX_COMMAND);
 		if (!poll_aux_status())
 			return -EIO;
-		outb_p(get_fs_byte(buffer++),AUX_OUTPUT_PORT);
+		outb_p(get_user(buffer++),AUX_OUTPUT_PORT);
 	}
 	inode->i_mtime = CURRENT_TIME;
 	return count;
@@ -361,7 +363,7 @@
 	while (i--) {
 		if (!poll_qp_status())
 			return -EIO;
-		outb_p(get_fs_byte(buffer++), qp_data);
+		outb_p(get_user(buffer++), qp_data);
 	}
 	inode->i_mtime = CURRENT_TIME;
 	return count;
@@ -394,7 +396,7 @@
 	}		
 	while (i > 0 && !queue_empty()) {
 		c = get_from_queue();
-		put_fs_byte(c, buffer++);
+		put_user(c, buffer++);
 		i--;
 	}
 	aux_ready = !queue_empty();
@@ -489,7 +491,7 @@
  		if (inb_p(AUX_STATUS) & AUX_OBUF_FULL == AUX_OBUF_FULL)
 			inb_p(AUX_INPUT_PORT);
 		current->state = TASK_INTERRUPTIBLE;
-		current->timeout = jiffies + 5;
+		current->timeout = jiffies + (5*HZ + 99) / 100;
 		schedule();
 		retries++;
 	}
@@ -512,7 +514,7 @@
 	        if (inb_p(qp_status)&(QP_RX_FULL))
 		        inb_p(qp_data);
 		current->state = TASK_INTERRUPTIBLE;
-		current->timeout = jiffies + 5;
+		current->timeout = jiffies + (5*HZ + 99) / 100;
 		schedule();
 		retries++;
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this