aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2014-06-05 16:05:55 +0200
committerJohan Hovold <johan@kernel.org>2014-07-07 10:10:34 +0200
commit47e575952bdbd6a9bbf9e087069c658322cb0622 (patch)
tree6ad7a68244c6761c62fbd246f182fab698034633 /drivers/usb/serial
parenta90d84adb43936f66ede77794940dc27156d58da (diff)
downloadlinux-stericsson-47e575952bdbd6a9bbf9e087069c658322cb0622.tar.gz
USB: ftdi_sio: clean up ftdi_set_max_packet_size()
Code and comment style clean ups of ftdi_set_max_packet_size(). Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/ftdi_sio.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 6cfa55a2f804..6451bf47b05b 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1556,16 +1556,16 @@ static void ftdi_determine_type(struct usb_serial_port *port)
}
-/* Determine the maximum packet size for the device. This depends on the chip
- * type and the USB host capabilities. The value should be obtained from the
- * device descriptor as the chip will use the appropriate values for the host.*/
+/*
+ * Determine the maximum packet size for the device. This depends on the chip
+ * type and the USB host capabilities. The value should be obtained from the
+ * device descriptor as the chip will use the appropriate values for the host.
+ */
static void ftdi_set_max_packet_size(struct usb_serial_port *port)
{
struct ftdi_private *priv = usb_get_serial_port_data(port);
- struct usb_serial *serial = port->serial;
- struct usb_interface *interface = serial->interface;
+ struct usb_interface *interface = port->serial->interface;
struct usb_endpoint_descriptor *ep_desc;
-
unsigned num_endpoints;
unsigned i;
@@ -1573,20 +1573,22 @@ static void ftdi_set_max_packet_size(struct usb_serial_port *port)
if (!num_endpoints)
return;
- /* NOTE: some customers have programmed FT232R/FT245R devices
- * with an endpoint size of 0 - not good. In this case, we
+ /*
+ * NOTE: Some customers have programmed FT232R/FT245R devices
+ * with an endpoint size of 0 - not good. In this case, we
* want to override the endpoint descriptor setting and use a
- * value of 64 for wMaxPacketSize */
+ * value of 64 for wMaxPacketSize.
+ */
for (i = 0; i < num_endpoints; i++) {
ep_desc = &interface->cur_altsetting->endpoint[i].desc;
- if (ep_desc->wMaxPacketSize == 0) {
+ if (!ep_desc->wMaxPacketSize) {
ep_desc->wMaxPacketSize = cpu_to_le16(0x40);
dev_warn(&port->dev, "Overriding wMaxPacketSize on endpoint %d\n",
usb_endpoint_num(ep_desc));
}
}
- /* set max packet size based on descriptor */
+ /* Set max packet size based on last descriptor. */
priv->max_packet_size = usb_endpoint_maxp(ep_desc);
}