lkml.org 
[lkml]   [2005]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 08/10] usb-serial: safe_serial driver port.

Ports the safe_serial 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/safe_serial.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)

diff -Nparu -X /home/lcapitulino/kernels/dontdiff a/drivers/usb/serial/safe_serial.c a~/drivers/usb/serial/safe_serial.c
--- a/drivers/usb/serial/safe_serial.c 2005-12-04 01:44:19.000000000 -0200
+++ a~/drivers/usb/serial/safe_serial.c 2005-12-04 15:14:04.000000000 -0200
@@ -69,7 +69,6 @@
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/module.h>
-#include <linux/spinlock.h>
#include <asm/uaccess.h>
#include <linux/usb.h>
#include "usb-serial.h"
@@ -299,14 +298,10 @@ static int safe_write (struct usb_serial
dbg ("%s - write request of 0 bytes", __FUNCTION__);
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);

packet_length = port->bulk_out_size; // get max packetsize

@@ -358,7 +353,7 @@ static int safe_write (struct usb_serial
#endif
port->write_urb->dev = port->serial->dev;
if ((result = usb_submit_urb (port->write_urb, GFP_KERNEL))) {
- port->write_urb_busy = 0;
+ usb_serial_write_urb_unlock(port);
err ("%s - failed submitting write urb, error %d", __FUNCTION__, result);
return 0;
}
@@ -373,7 +368,7 @@ static int safe_write_room (struct usb_s

dbg ("%s", __FUNCTION__);

- if (port->write_urb_busy)
+ if (usb_serial_write_urb_locked(port))
room = port->bulk_out_size - (safe ? 2 : 0);

if (room) {

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

\
 
 \ /
  Last update: 2005-12-06 13:19    [W:0.023 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site