summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/belkin_sa.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2010-05-15 17:53:52 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 22:21:48 +0200
commitf2f8b7fe5a7542df8e3c906fcc9897b596bbf1fc (patch)
tree5473b4448af468b06ab5ca10f6e65c6e46f5ae09 /drivers/usb/serial/belkin_sa.c
parentUSB: belkin_sa: minor clean-ups (diff)
downloadlinux-f2f8b7fe5a7542df8e3c906fcc9897b596bbf1fc.tar.xz
linux-f2f8b7fe5a7542df8e3c906fcc9897b596bbf1fc.zip
USB: belkin_sa: clean up open
Use generic open to submit read urb. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/belkin_sa.c')
-rw-r--r--drivers/usb/serial/belkin_sa.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index 9dbb07ea76ec..c39673608c35 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -207,29 +207,20 @@ static void belkin_sa_release(struct usb_serial *serial)
static int belkin_sa_open(struct tty_struct *tty,
struct usb_serial_port *port)
{
- int retval = 0;
+ int retval;
dbg("%s port %d", __func__, port->number);
- /*Start reading from the device*/
- /* TODO: Look at possibility of submitting multiple URBs to device to
- * enhance buffering. Win trace shows 16 initial read URBs.
- */
- port->read_urb->dev = port->serial->dev;
- retval = usb_submit_urb(port->read_urb, GFP_KERNEL);
- if (retval) {
- dev_err(&port->dev, "usb_submit_urb(read bulk) failed\n");
- goto exit;
- }
-
- port->interrupt_in_urb->dev = port->serial->dev;
retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (retval) {
- usb_kill_urb(port->read_urb);
dev_err(&port->dev, "usb_submit_urb(read int) failed\n");
+ return retval;
}
-exit:
+ retval = usb_serial_generic_open(tty, port);
+ if (retval)
+ usb_kill_urb(port->interrupt_in_urb);
+
return retval;
}