Skip to content

Commit

Permalink
cypress_m8: use usb_fill_int_urb where appropriate
Browse files Browse the repository at this point in the history
Rather than directly filling in URB fields, it's safer to use
usb_fill_int_urb().  This improves robustness of the driver; URB
changes in the future will not go uninitialized here.  That point not
withstanding, this driver should at least be self-consistent.  Either
use usb_fill_int_urb() everywhere or don't bother with it all.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Mike Isely authored and Greg Kroah-Hartman committed Sep 27, 2006
1 parent 0257fa9 commit 9aa8dae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/usb/serial/cypress_m8.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,9 +820,10 @@ static void cypress_send(struct usb_serial_port *port)
usb_serial_debug_data(debug, &port->dev, __FUNCTION__, port->interrupt_out_size,
port->interrupt_out_urb->transfer_buffer);

port->interrupt_out_urb->transfer_buffer_length = actual_size;
port->interrupt_out_urb->dev = port->serial->dev;
port->interrupt_out_urb->interval = priv->write_urb_interval;
usb_fill_int_urb(port->interrupt_out_urb, port->serial->dev,
usb_sndintpipe(port->serial->dev, port->interrupt_out_endpointAddress),
port->interrupt_out_buffer, port->interrupt_out_size,
cypress_write_int_callback, port, priv->write_urb_interval);
result = usb_submit_urb (port->interrupt_out_urb, GFP_ATOMIC);
if (result) {
dev_err(&port->dev, "%s - failed submitting write urb, error %d\n", __FUNCTION__,
Expand Down

0 comments on commit 9aa8dae

Please sign in to comment.