Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: serial: ftdi_sio: rename chip types

Shorten the chip type enum and string representation for A, B and R chip
types so that they don't include the IC package type in the name.

Signed-off-by: Johan Hovold <johan@kernel.org>

+30 -30
+30 -30
drivers/usb/serial/ftdi_sio.c
··· 49 49 50 50 enum ftdi_chip_type { 51 51 SIO, 52 - FT8U232AM, 53 - FT232BM, 52 + FT232A, 53 + FT232B, 54 54 FT2232C, 55 - FT232RL, 55 + FT232R, 56 + FT232H, 56 57 FT2232H, 57 58 FT4232H, 58 - FT232H, 59 59 FTX, 60 60 }; 61 61 ··· 1071 1071 MODULE_DEVICE_TABLE(usb, id_table_combined); 1072 1072 1073 1073 static const char *ftdi_chip_name[] = { 1074 - [SIO] = "SIO", /* the serial part of FT8U100AX */ 1075 - [FT8U232AM] = "FT8U232AM", 1076 - [FT232BM] = "FT232BM", 1077 - [FT2232C] = "FT2232C", 1078 - [FT232RL] = "FT232RL", 1079 - [FT2232H] = "FT2232H", 1080 - [FT4232H] = "FT4232H", 1081 - [FT232H] = "FT232H", 1082 - [FTX] = "FT-X" 1074 + [SIO] = "SIO", /* the serial part of FT8U100AX */ 1075 + [FT232A] = "FT232A", 1076 + [FT232B] = "FT232B", 1077 + [FT2232C] = "FT2232C", 1078 + [FT232R] = "FT232R", 1079 + [FT232H] = "FT232H", 1080 + [FT2232H] = "FT2232H", 1081 + [FT4232H] = "FT4232H", 1082 + [FTX] = "FT-X", 1083 1083 }; 1084 1084 1085 1085 ··· 1337 1337 div_okay = 0; 1338 1338 } 1339 1339 break; 1340 - case FT8U232AM: 1340 + case FT232A: 1341 1341 if (baud <= 3000000) { 1342 1342 div_value = ftdi_232am_baud_to_divisor(baud); 1343 1343 } else { ··· 1347 1347 div_okay = 0; 1348 1348 } 1349 1349 break; 1350 - case FT232BM: 1350 + case FT232B: 1351 1351 case FT2232C: 1352 - case FT232RL: 1352 + case FT232R: 1353 1353 case FTX: 1354 1354 if (baud <= 3000000) { 1355 1355 u16 product_id = le16_to_cpu( ··· 1431 1431 int rv; 1432 1432 int l = priv->latency; 1433 1433 1434 - if (priv->chip_type == SIO || priv->chip_type == FT8U232AM) 1434 + if (priv->chip_type == SIO || priv->chip_type == FT232A) 1435 1435 return -EINVAL; 1436 1436 1437 1437 if (priv->flags & ASYNC_LOW_LATENCY) ··· 1472 1472 struct ftdi_private *priv = usb_get_serial_port_data(port); 1473 1473 int rv; 1474 1474 1475 - if (priv->chip_type == SIO || priv->chip_type == FT8U232AM) 1475 + if (priv->chip_type == SIO || priv->chip_type == FT232A) 1476 1476 return -EINVAL; 1477 1477 1478 1478 rv = _read_latency_timer(port); ··· 1603 1603 priv->baud_base = 12000000 / 16; 1604 1604 } else if (version < 0x400) { 1605 1605 /* Assume it's an FT8U232AM (or FT8U245AM) */ 1606 - priv->chip_type = FT8U232AM; 1606 + priv->chip_type = FT232A; 1607 1607 /* 1608 1608 * It might be a BM type because of the iSerialNumber bug. 1609 1609 * If iSerialNumber==0 and the latency timer is readable, ··· 1614 1614 dev_dbg(&port->dev, 1615 1615 "%s: has latency timer so not an AM type\n", 1616 1616 __func__); 1617 - priv->chip_type = FT232BM; 1617 + priv->chip_type = FT232B; 1618 1618 } 1619 1619 } else if (version < 0x600) { 1620 1620 /* Assume it's an FT232BM (or FT245BM) */ 1621 - priv->chip_type = FT232BM; 1621 + priv->chip_type = FT232B; 1622 1622 } else if (version < 0x900) { 1623 1623 /* Assume it's an FT232RL */ 1624 - priv->chip_type = FT232RL; 1624 + priv->chip_type = FT232R; 1625 1625 } else if (version < 0x1000) { 1626 1626 /* Assume it's an FT232H */ 1627 1627 priv->chip_type = FT232H; ··· 1751 1751 dev_dbg(&port->dev, "sysfs attributes for %s\n", ftdi_chip_name[priv->chip_type]); 1752 1752 retval = device_create_file(&port->dev, &dev_attr_event_char); 1753 1753 if ((!retval) && 1754 - (priv->chip_type == FT232BM || 1754 + (priv->chip_type == FT232B || 1755 1755 priv->chip_type == FT2232C || 1756 - priv->chip_type == FT232RL || 1756 + priv->chip_type == FT232R || 1757 1757 priv->chip_type == FT2232H || 1758 1758 priv->chip_type == FT4232H || 1759 1759 priv->chip_type == FT232H || ··· 1772 1772 /* XXX see create_sysfs_attrs */ 1773 1773 if (priv->chip_type != SIO) { 1774 1774 device_remove_file(&port->dev, &dev_attr_event_char); 1775 - if (priv->chip_type == FT232BM || 1775 + if (priv->chip_type == FT232B || 1776 1776 priv->chip_type == FT2232C || 1777 - priv->chip_type == FT232RL || 1777 + priv->chip_type == FT232R || 1778 1778 priv->chip_type == FT2232H || 1779 1779 priv->chip_type == FT4232H || 1780 1780 priv->chip_type == FT232H || ··· 2152 2152 case FT232H: 2153 2153 result = ftdi_gpio_init_ft232h(port); 2154 2154 break; 2155 - case FT232RL: 2155 + case FT232R: 2156 2156 result = ftdi_gpio_init_ft232r(port); 2157 2157 break; 2158 2158 case FTX: ··· 2837 2837 case SIO: 2838 2838 len = 1; 2839 2839 break; 2840 - case FT8U232AM: 2841 - case FT232BM: 2840 + case FT232A: 2841 + case FT232B: 2842 2842 case FT2232C: 2843 - case FT232RL: 2843 + case FT232R: 2844 2844 case FT2232H: 2845 2845 case FT4232H: 2846 2846 case FT232H: