From: Luiz Fernando Capitulino <lcapitulino@mandriva.com.br>
To: gregkh@suse.de
Cc: linux-kernel@vger.kernel.org,
linux-usb-devel@lists.sourceforge.net, ehabkost@mandriva.com
Subject: [PATCH 05/10] usb-serial: ir-usb driver port.
Date: Tue, 6 Dec 2005 10:00:29 -0200 [thread overview]
Message-ID: <20051206100029.6a2dbf6f.lcapitulino@mandriva.com.br> (raw)
Ports the ir-usb 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/ir-usb.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff -Nparu -X /home/lcapitulino/kernels/dontdiff a/drivers/usb/serial/ir-usb.c a~/drivers/usb/serial/ir-usb.c
--- a/drivers/usb/serial/ir-usb.c 2005-12-04 01:44:19.000000000 -0200
+++ a~/drivers/usb/serial/ir-usb.c 2005-12-04 14:43:39.000000000 -0200
@@ -55,7 +55,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"
@@ -344,14 +343,10 @@ static int ir_write (struct usb_serial_p
if (count == 0)
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);
transfer_buffer = port->write_urb->transfer_buffer;
transfer_size = min(count, port->bulk_out_size - 1);
@@ -382,7 +377,7 @@ static int ir_write (struct usb_serial_p
result = usb_submit_urb (port->write_urb, GFP_ATOMIC);
if (result) {
- port->write_urb_busy = 0;
+ usb_serial_write_urb_unlock(port);
dev_err(&port->dev, "%s - failed submitting write urb, error %d\n", __FUNCTION__, result);
} else
result = transfer_size;
@@ -396,7 +391,7 @@ static void ir_write_bulk_callback (stru
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
reply other threads:[~2005-12-06 12:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051206100029.6a2dbf6f.lcapitulino@mandriva.com.br \
--to=lcapitulino@mandriva.com.br \
--cc=ehabkost@mandriva.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®