@@ -1556,37 +1556,39 @@ static void ftdi_determine_type(struct usb_serial_port *port)
1556
1556
}
1557
1557
1558
1558
1559
- /* Determine the maximum packet size for the device. This depends on the chip
1560
- * type and the USB host capabilities. The value should be obtained from the
1561
- * device descriptor as the chip will use the appropriate values for the host.*/
1559
+ /*
1560
+ * Determine the maximum packet size for the device. This depends on the chip
1561
+ * type and the USB host capabilities. The value should be obtained from the
1562
+ * device descriptor as the chip will use the appropriate values for the host.
1563
+ */
1562
1564
static void ftdi_set_max_packet_size (struct usb_serial_port * port )
1563
1565
{
1564
1566
struct ftdi_private * priv = usb_get_serial_port_data (port );
1565
- struct usb_serial * serial = port -> serial ;
1566
- struct usb_interface * interface = serial -> interface ;
1567
+ struct usb_interface * interface = port -> serial -> interface ;
1567
1568
struct usb_endpoint_descriptor * ep_desc ;
1568
-
1569
1569
unsigned num_endpoints ;
1570
1570
unsigned i ;
1571
1571
1572
1572
num_endpoints = interface -> cur_altsetting -> desc .bNumEndpoints ;
1573
1573
if (!num_endpoints )
1574
1574
return ;
1575
1575
1576
- /* NOTE: some customers have programmed FT232R/FT245R devices
1577
- * with an endpoint size of 0 - not good. In this case, we
1576
+ /*
1577
+ * NOTE: Some customers have programmed FT232R/FT245R devices
1578
+ * with an endpoint size of 0 - not good. In this case, we
1578
1579
* want to override the endpoint descriptor setting and use a
1579
- * value of 64 for wMaxPacketSize */
1580
+ * value of 64 for wMaxPacketSize.
1581
+ */
1580
1582
for (i = 0 ; i < num_endpoints ; i ++ ) {
1581
1583
ep_desc = & interface -> cur_altsetting -> endpoint [i ].desc ;
1582
- if (ep_desc -> wMaxPacketSize == 0 ) {
1584
+ if (! ep_desc -> wMaxPacketSize ) {
1583
1585
ep_desc -> wMaxPacketSize = cpu_to_le16 (0x40 );
1584
1586
dev_warn (& port -> dev , "Overriding wMaxPacketSize on endpoint %d\n" ,
1585
1587
usb_endpoint_num (ep_desc ));
1586
1588
}
1587
1589
}
1588
1590
1589
- /* set max packet size based on descriptor */
1591
+ /* Set max packet size based on last descriptor. */
1590
1592
priv -> max_packet_size = usb_endpoint_maxp (ep_desc );
1591
1593
}
1592
1594
0 commit comments