ChangeSet 1.2181.4.24, 2005/03/17 18:13:15-08:00, [EMAIL PROTECTED] [PATCH] usb/digi_acceleport: remove interruptible_sleep_on_timeout() usage
Replace deprecated interruptible_sleep_on_timeout() with direct wait-queue usage. Also replace some rather odd wait-queue usage with the existent macros. Also adjusted the wake_up_interruptible() call appropriately, as I changed all the states to TASK_UNINTERRUPTIBLE (signals were not be checked in the current code). Patch is compile-tested. Signed-off-by: Nishanth Aravamudan <[EMAIL PROTECTED]> Signed-off-by: Domen Puncer <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> drivers/usb/serial/digi_acceleport.c | 29 +++++++++++------------------ 1 files changed, 11 insertions(+), 18 deletions(-) diff -Nru a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c --- a/drivers/usb/serial/digi_acceleport.c 2005-03-30 13:38:11 -08:00 +++ b/drivers/usb/serial/digi_acceleport.c 2005-03-30 13:38:11 -08:00 @@ -246,6 +246,7 @@ #include <linux/workqueue.h> #include <asm/uaccess.h> #include <linux/usb.h> +#include <linux/wait.h> #include "usb-serial.h" /* Defines */ @@ -573,23 +574,14 @@ wait_queue_head_t *q, long timeout, spinlock_t *lock, unsigned long flags ) { + DEFINE_WAIT(wait); - wait_queue_t wait; - - - init_waitqueue_entry( &wait, current ); - - set_current_state( TASK_INTERRUPTIBLE ); - - add_wait_queue( q, &wait ); - - spin_unlock_irqrestore( lock, flags ); - + prepare_to_wait(q, &wait, TASK_UNINTERRUPTIBLE); + spin_unlock_irqrestore(lock, flags); timeout = schedule_timeout(timeout); + finish_wait(q, &wait); - remove_wait_queue( q, &wait ); - - return( timeout ); + return timeout; } @@ -1528,7 +1520,7 @@ static void digi_close( struct usb_serial_port *port, struct file *filp ) { - + DEFINE_WAIT(wait); int ret; unsigned char buf[32]; struct tty_struct *tty = port->tty; @@ -1604,8 +1596,9 @@ dbg( "digi_close: write oob failed, ret=%d", ret ); /* wait for final commands on oob port to complete */ - interruptible_sleep_on_timeout( &priv->dp_flush_wait, - DIGI_CLOSE_TIMEOUT ); + prepare_to_wait(&priv->dp_flush_wait, &wait, TASK_UNINTERRUPTIBLE); + schedule_timeout(DIGI_CLOSE_TIMEOUT); + finish_wait(&priv->dp_flush_wait, &wait); /* shutdown any outstanding bulk writes */ usb_kill_urb(port->write_urb); @@ -2002,7 +1995,7 @@ } else if( opcode == DIGI_CMD_IFLUSH_FIFO ) { - wake_up_interruptible( &priv->dp_flush_wait ); + wake_up( &priv->dp_flush_wait ); } ------------------------------------------------------- This SF.net email is sponsored by Demarc: A global provider of Threat Management Solutions. Download our HomeAdmin security software for free today! http://www.demarc.com/info/Sentarus/hamr30 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel