Skip to content

Commit f2f8b7f

Browse files
jhovoldgregkh
authored andcommitted
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>
1 parent 726ef42 commit f2f8b7f

1 file changed

Lines changed: 6 additions & 15 deletions

File tree

‎drivers/usb/serial/belkin_sa.c‎

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -207,29 +207,20 @@ static void belkin_sa_release(struct usb_serial *serial)
207207
static int belkin_sa_open(struct tty_struct *tty,
208208
struct usb_serial_port *port)
209209
{
210-
int retval = 0;
210+
int retval;
211211

212212
dbg("%s port %d", __func__, port->number);
213213

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;
226214
retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
227215
if (retval) {
228-
usb_kill_urb(port->read_urb);
229216
dev_err(&port->dev, "usb_submit_urb(read int) failed\n");
217+
return retval;
230218
}
231219

232-
exit:
220+
retval = usb_serial_generic_open(tty, port);
221+
if (retval)
222+
usb_kill_urb(port->interrupt_in_urb);
223+
233224
return retval;
234225
}
235226

0 commit comments

Comments
 (0)