diff options
author | Johan Hovold <jhovold@gmail.com> | 2010-05-15 11:53:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:48 -0400 |
commit | f2f8b7fe5a7542df8e3c906fcc9897b596bbf1fc (patch) | |
tree | 5473b4448af468b06ab5ca10f6e65c6e46f5ae09 /drivers/usb | |
parent | 726ef428af41b1fbdf569772ab73de0844c4e0f2 (diff) |
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')
-rw-r--r-- | drivers/usb/serial/belkin_sa.c | 21 |
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) | |||
207 | static int belkin_sa_open(struct tty_struct *tty, | 207 | static int belkin_sa_open(struct tty_struct *tty, |
208 | struct usb_serial_port *port) | 208 | struct usb_serial_port *port) |
209 | { | 209 | { |
210 | int retval = 0; | 210 | int retval; |
211 | 211 | ||
212 | dbg("%s port %d", __func__, port->number); | 212 | dbg("%s port %d", __func__, port->number); |
213 | 213 | ||
214 | /*Start reading from the device*/ | ||
215 | /* TODO: Look at possibility of submitting multiple URBs to device to | ||
216 | * enhance buffering. Win trace shows 16 initial read URBs. | ||
217 | */ | ||
218 | port->read_urb->dev = port->serial->dev; | ||
219 | retval = usb_submit_urb(port->read_urb, GFP_KERNEL); | ||
220 | if (retval) { | ||
221 | dev_err(&port->dev, "usb_submit_urb(read bulk) failed\n"); | ||
222 | goto exit; | ||
223 | } | ||
224 | |||
225 | port->interrupt_in_urb->dev = port->serial->dev; | ||
226 | retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); | 214 | retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); |
227 | if (retval) { | 215 | if (retval) { |
228 | usb_kill_urb(port->read_urb); | ||
229 | dev_err(&port->dev, "usb_submit_urb(read int) failed\n"); | 216 | dev_err(&port->dev, "usb_submit_urb(read int) failed\n"); |
217 | return retval; | ||
230 | } | 218 | } |
231 | 219 | ||
232 | exit: | 220 | retval = usb_serial_generic_open(tty, port); |
221 | if (retval) | ||
222 | usb_kill_urb(port->interrupt_in_urb); | ||
223 | |||
233 | return retval; | 224 | return retval; |
234 | } | 225 | } |
235 | 226 | ||