[PATCH 03/10] usb-serial: cyberjack driver port.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  Ports the cyberjack driver from write_urb_busy spin_lock to
usb_serial_write_urb_lock() functions.

Signed-off-by: Luiz Capitulino <[email protected]>

 drivers/usb/serial/cyberjack.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff -Nparu -X /home/lcapitulino/kernels/dontdiff a/drivers/usb/serial/cyberjack.c a~/drivers/usb/serial/cyberjack.c
--- a/drivers/usb/serial/cyberjack.c	2005-12-04 19:19:57.000000000 -0200
+++ a~/drivers/usb/serial/cyberjack.c	2005-12-04 19:25:50.000000000 -0200
@@ -215,14 +215,10 @@ static int cyberjack_write (struct usb_s
 		return (0);
 	}
 
-	spin_lock(&port->lock);
-	if (port->write_urb_busy) {
-		spin_unlock(&port->lock);
+	if (usb_serial_write_urb_lock(port)) {
 		dbg("%s - already writing", __FUNCTION__);
 		return 0;
 	}
-	port->write_urb_busy = 1;
-	spin_unlock(&port->lock);
 
 	spin_lock_irqsave(&priv->lock, flags);
 
@@ -230,7 +226,7 @@ static int cyberjack_write (struct usb_s
 		/* To much data for buffer. Reset buffer. */
 		priv->wrfilled=0;
 		spin_unlock_irqrestore(&priv->lock, flags);
-		port->write_urb_busy = 0;
+		usb_serial_write_urb_unlock(port);
 		return (0);
 	}
 
@@ -275,7 +271,7 @@ static int cyberjack_write (struct usb_s
 			priv->wrfilled=0;
 			priv->wrsent=0;
 			spin_unlock_irqrestore(&priv->lock, flags);
-			port->write_urb_busy = 0;
+			usb_serial_write_urb_unlock(port);
 			return 0;
 		}
 
@@ -421,7 +417,7 @@ static void cyberjack_write_bulk_callbac
 
 	dbg("%s - port %d", __FUNCTION__, port->number);
 
-	port->write_urb_busy = 0;
+	usb_serial_write_urb_unlock(port);
 	if (urb->status) {
 		dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
 		return;


-- 
Luiz Fernando N. Capitulino
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux