mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 07/10] usb-serial: omninet driver port.
@ 2005-12-06 12:01 Luiz Fernando Capitulino
  0 siblings, 0 replies; only message in thread
From: Luiz Fernando Capitulino @ 2005-12-06 12:01 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-usb-devel, ehabkost


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

Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>

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

diff -Nparu -X /home/lcapitulino/kernels/dontdiff a/drivers/usb/serial/omninet.c a~/drivers/usb/serial/omninet.c
--- a/drivers/usb/serial/omninet.c	2005-12-04 01:44:19.000000000 -0200
+++ a~/drivers/usb/serial/omninet.c	2005-12-04 15:08:27.000000000 -0200
@@ -257,14 +257,10 @@ static int omninet_write (struct usb_ser
 		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);
 
 	count = (count > OMNINET_BULKOUTSIZE) ? OMNINET_BULKOUTSIZE : count;
 
@@ -283,7 +279,7 @@ static int omninet_write (struct usb_ser
 	wport->write_urb->dev = serial->dev;
 	result = usb_submit_urb(wport->write_urb, GFP_ATOMIC);
 	if (result) {
-		port->write_urb_busy = 0;
+		usb_serial_write_urb_unlock(port);
 		err("%s - failed submitting write urb, error %d", __FUNCTION__, result);
 	} else
 		result = count;
@@ -299,7 +295,7 @@ static int omninet_write_room (struct us
 
 	int room = 0; // Default: no room
 
-	if (wport->write_urb_busy)
+	if (usb_serial_write_urb_locked(wport))
 		room = wport->bulk_out_size - OMNINET_HEADERLEN;
 
 //	dbg("omninet_write_room returns %d", room);
@@ -314,7 +310,7 @@ static void omninet_write_bulk_callback 
 
 //	dbg("omninet_write_bulk_callback, port %0x\n", port);
 
-	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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-12-06 12:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-06 12:01 [PATCH 07/10] usb-serial: omninet driver port Luiz Fernando Capitulino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®