diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-14 12:47:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-14 12:47:42 -0400 |
commit | bfc51614b389f5c7a05181accfef38ccdd66661e (patch) | |
tree | f590e991821a507454022153b6ffa48410649989 /drivers/usb/serial | |
parent | f9dfbebb8b39b692474a30e9430073577dd88d7c (diff) |
USB: serial: ftdi_sio.c: remove dbg() usage
dbg() was a very old USB-serial-specific macro.
This patch removes it from being used in the
driver and uses dev_dbg() instead.
CC: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
CC: Simon Arlott <simon@fire.lp0.eu>
CC: Andrew Worsley <amworsley@gmail.com>
CC: "Michał Wróbel" <michal.wrobel@flytronic.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 119 |
1 files changed, 60 insertions, 59 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 29b81ad421fe..5f8f172fcc52 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -1043,11 +1043,12 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set, | |||
1043 | unsigned int clear) | 1043 | unsigned int clear) |
1044 | { | 1044 | { |
1045 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 1045 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1046 | struct device *dev = &port->dev; | ||
1046 | unsigned urb_value; | 1047 | unsigned urb_value; |
1047 | int rv; | 1048 | int rv; |
1048 | 1049 | ||
1049 | if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) { | 1050 | if (((set | clear) & (TIOCM_DTR | TIOCM_RTS)) == 0) { |
1050 | dbg("%s - DTR|RTS not being set|cleared", __func__); | 1051 | dev_dbg(dev, "%s - DTR|RTS not being set|cleared\n", __func__); |
1051 | return 0; /* no change */ | 1052 | return 0; /* no change */ |
1052 | } | 1053 | } |
1053 | 1054 | ||
@@ -1068,18 +1069,14 @@ static int update_mctrl(struct usb_serial_port *port, unsigned int set, | |||
1068 | urb_value, priv->interface, | 1069 | urb_value, priv->interface, |
1069 | NULL, 0, WDR_TIMEOUT); | 1070 | NULL, 0, WDR_TIMEOUT); |
1070 | if (rv < 0) { | 1071 | if (rv < 0) { |
1071 | dbg("%s Error from MODEM_CTRL urb: DTR %s, RTS %s", | 1072 | dev_dbg(dev, "%s Error from MODEM_CTRL urb: DTR %s, RTS %s\n", |
1072 | __func__, | 1073 | __func__, |
1073 | (set & TIOCM_DTR) ? "HIGH" : | 1074 | (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", |
1074 | (clear & TIOCM_DTR) ? "LOW" : "unchanged", | 1075 | (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); |
1075 | (set & TIOCM_RTS) ? "HIGH" : | ||
1076 | (clear & TIOCM_RTS) ? "LOW" : "unchanged"); | ||
1077 | } else { | 1076 | } else { |
1078 | dbg("%s - DTR %s, RTS %s", __func__, | 1077 | dev_dbg(dev, "%s - DTR %s, RTS %s\n", __func__, |
1079 | (set & TIOCM_DTR) ? "HIGH" : | 1078 | (set & TIOCM_DTR) ? "HIGH" : (clear & TIOCM_DTR) ? "LOW" : "unchanged", |
1080 | (clear & TIOCM_DTR) ? "LOW" : "unchanged", | 1079 | (set & TIOCM_RTS) ? "HIGH" : (clear & TIOCM_RTS) ? "LOW" : "unchanged"); |
1081 | (set & TIOCM_RTS) ? "HIGH" : | ||
1082 | (clear & TIOCM_RTS) ? "LOW" : "unchanged"); | ||
1083 | /* FIXME: locking on last_dtr_rts */ | 1080 | /* FIXME: locking on last_dtr_rts */ |
1084 | priv->last_dtr_rts = (priv->last_dtr_rts & ~clear) | set; | 1081 | priv->last_dtr_rts = (priv->last_dtr_rts & ~clear) | set; |
1085 | } | 1082 | } |
@@ -1091,6 +1088,7 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty, | |||
1091 | struct usb_serial_port *port) | 1088 | struct usb_serial_port *port) |
1092 | { | 1089 | { |
1093 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 1090 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1091 | struct device *dev = &port->dev; | ||
1094 | __u32 div_value = 0; | 1092 | __u32 div_value = 0; |
1095 | int div_okay = 1; | 1093 | int div_okay = 1; |
1096 | int baud; | 1094 | int baud; |
@@ -1126,7 +1124,7 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty, | |||
1126 | alt_speed hack */ | 1124 | alt_speed hack */ |
1127 | 1125 | ||
1128 | baud = tty_get_baud_rate(tty); | 1126 | baud = tty_get_baud_rate(tty); |
1129 | dbg("%s - tty_get_baud_rate reports speed %d", __func__, baud); | 1127 | dev_dbg(dev, "%s - tty_get_baud_rate reports speed %d\n", __func__, baud); |
1130 | 1128 | ||
1131 | /* 2. Observe async-compatible custom_divisor hack, update baudrate | 1129 | /* 2. Observe async-compatible custom_divisor hack, update baudrate |
1132 | if needed */ | 1130 | if needed */ |
@@ -1135,8 +1133,8 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty, | |||
1135 | ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && | 1133 | ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && |
1136 | (priv->custom_divisor)) { | 1134 | (priv->custom_divisor)) { |
1137 | baud = priv->baud_base / priv->custom_divisor; | 1135 | baud = priv->baud_base / priv->custom_divisor; |
1138 | dbg("%s - custom divisor %d sets baud rate to %d", | 1136 | dev_dbg(dev, "%s - custom divisor %d sets baud rate to %d\n", |
1139 | __func__, priv->custom_divisor, baud); | 1137 | __func__, priv->custom_divisor, baud); |
1140 | } | 1138 | } |
1141 | 1139 | ||
1142 | /* 3. Convert baudrate to device-specific divisor */ | 1140 | /* 3. Convert baudrate to device-specific divisor */ |
@@ -1158,8 +1156,8 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty, | |||
1158 | case 115200: div_value = ftdi_sio_b115200; break; | 1156 | case 115200: div_value = ftdi_sio_b115200; break; |
1159 | } /* baud */ | 1157 | } /* baud */ |
1160 | if (div_value == 0) { | 1158 | if (div_value == 0) { |
1161 | dbg("%s - Baudrate (%d) requested is not supported", | 1159 | dev_dbg(dev, "%s - Baudrate (%d) requested is not supported\n", |
1162 | __func__, baud); | 1160 | __func__, baud); |
1163 | div_value = ftdi_sio_b9600; | 1161 | div_value = ftdi_sio_b9600; |
1164 | baud = 9600; | 1162 | baud = 9600; |
1165 | div_okay = 0; | 1163 | div_okay = 0; |
@@ -1169,7 +1167,7 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty, | |||
1169 | if (baud <= 3000000) { | 1167 | if (baud <= 3000000) { |
1170 | div_value = ftdi_232am_baud_to_divisor(baud); | 1168 | div_value = ftdi_232am_baud_to_divisor(baud); |
1171 | } else { | 1169 | } else { |
1172 | dbg("%s - Baud rate too high!", __func__); | 1170 | dev_dbg(dev, "%s - Baud rate too high!\n", __func__); |
1173 | baud = 9600; | 1171 | baud = 9600; |
1174 | div_value = ftdi_232am_baud_to_divisor(9600); | 1172 | div_value = ftdi_232am_baud_to_divisor(9600); |
1175 | div_okay = 0; | 1173 | div_okay = 0; |
@@ -1192,7 +1190,7 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty, | |||
1192 | } | 1190 | } |
1193 | div_value = ftdi_232bm_baud_to_divisor(baud); | 1191 | div_value = ftdi_232bm_baud_to_divisor(baud); |
1194 | } else { | 1192 | } else { |
1195 | dbg("%s - Baud rate too high!", __func__); | 1193 | dev_dbg(dev, "%s - Baud rate too high!\n", __func__); |
1196 | div_value = ftdi_232bm_baud_to_divisor(9600); | 1194 | div_value = ftdi_232bm_baud_to_divisor(9600); |
1197 | div_okay = 0; | 1195 | div_okay = 0; |
1198 | baud = 9600; | 1196 | baud = 9600; |
@@ -1206,7 +1204,7 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty, | |||
1206 | } else if (baud < 1200) { | 1204 | } else if (baud < 1200) { |
1207 | div_value = ftdi_232bm_baud_to_divisor(baud); | 1205 | div_value = ftdi_232bm_baud_to_divisor(baud); |
1208 | } else { | 1206 | } else { |
1209 | dbg("%s - Baud rate too high!", __func__); | 1207 | dev_dbg(dev, "%s - Baud rate too high!\n", __func__); |
1210 | div_value = ftdi_232bm_baud_to_divisor(9600); | 1208 | div_value = ftdi_232bm_baud_to_divisor(9600); |
1211 | div_okay = 0; | 1209 | div_okay = 0; |
1212 | baud = 9600; | 1210 | baud = 9600; |
@@ -1215,7 +1213,7 @@ static __u32 get_ftdi_divisor(struct tty_struct *tty, | |||
1215 | } /* priv->chip_type */ | 1213 | } /* priv->chip_type */ |
1216 | 1214 | ||
1217 | if (div_okay) { | 1215 | if (div_okay) { |
1218 | dbg("%s - Baud rate set to %d (divisor 0x%lX) on chip %s", | 1216 | dev_dbg(dev, "%s - Baud rate set to %d (divisor 0x%lX) on chip %s\n", |
1219 | __func__, baud, (unsigned long)div_value, | 1217 | __func__, baud, (unsigned long)div_value, |
1220 | ftdi_chip_name[priv->chip_type]); | 1218 | ftdi_chip_name[priv->chip_type]); |
1221 | } | 1219 | } |
@@ -1261,7 +1259,7 @@ static int write_latency_timer(struct usb_serial_port *port) | |||
1261 | if (priv->flags & ASYNC_LOW_LATENCY) | 1259 | if (priv->flags & ASYNC_LOW_LATENCY) |
1262 | l = 1; | 1260 | l = 1; |
1263 | 1261 | ||
1264 | dbg("%s: setting latency timer = %i", __func__, l); | 1262 | dev_dbg(&port->dev, "%s: setting latency timer = %i\n", __func__, l); |
1265 | 1263 | ||
1266 | rv = usb_control_msg(udev, | 1264 | rv = usb_control_msg(udev, |
1267 | usb_sndctrlpipe(udev, 0), | 1265 | usb_sndctrlpipe(udev, 0), |
@@ -1416,8 +1414,8 @@ static void ftdi_determine_type(struct usb_serial_port *port) | |||
1416 | 1414 | ||
1417 | version = le16_to_cpu(udev->descriptor.bcdDevice); | 1415 | version = le16_to_cpu(udev->descriptor.bcdDevice); |
1418 | interfaces = udev->actconfig->desc.bNumInterfaces; | 1416 | interfaces = udev->actconfig->desc.bNumInterfaces; |
1419 | dbg("%s: bcdDevice = 0x%x, bNumInterfaces = %u", __func__, | 1417 | dev_dbg(&port->dev, "%s: bcdDevice = 0x%x, bNumInterfaces = %u\n", __func__, |
1420 | version, interfaces); | 1418 | version, interfaces); |
1421 | if (interfaces > 1) { | 1419 | if (interfaces > 1) { |
1422 | int inter; | 1420 | int inter; |
1423 | 1421 | ||
@@ -1447,8 +1445,9 @@ static void ftdi_determine_type(struct usb_serial_port *port) | |||
1447 | /* BM-type devices have a bug where bcdDevice gets set | 1445 | /* BM-type devices have a bug where bcdDevice gets set |
1448 | * to 0x200 when iSerialNumber is 0. */ | 1446 | * to 0x200 when iSerialNumber is 0. */ |
1449 | if (version < 0x500) { | 1447 | if (version < 0x500) { |
1450 | dbg("%s: something fishy - bcdDevice too low for multi-interface device", | 1448 | dev_dbg(&port->dev, |
1451 | __func__); | 1449 | "%s: something fishy - bcdDevice too low for multi-interface device\n", |
1450 | __func__); | ||
1452 | } | 1451 | } |
1453 | } else if (version < 0x200) { | 1452 | } else if (version < 0x200) { |
1454 | /* Old device. Assume it's the original SIO. */ | 1453 | /* Old device. Assume it's the original SIO. */ |
@@ -1562,7 +1561,7 @@ static ssize_t store_event_char(struct device *dev, | |||
1562 | int v = simple_strtoul(valbuf, NULL, 10); | 1561 | int v = simple_strtoul(valbuf, NULL, 10); |
1563 | int rv; | 1562 | int rv; |
1564 | 1563 | ||
1565 | dbg("%s: setting event char = %i", __func__, v); | 1564 | dev_dbg(&port->dev, "%s: setting event char = %i\n", __func__, v); |
1566 | 1565 | ||
1567 | rv = usb_control_msg(udev, | 1566 | rv = usb_control_msg(udev, |
1568 | usb_sndctrlpipe(udev, 0), | 1567 | usb_sndctrlpipe(udev, 0), |
@@ -1571,7 +1570,7 @@ static ssize_t store_event_char(struct device *dev, | |||
1571 | v, priv->interface, | 1570 | v, priv->interface, |
1572 | NULL, 0, WDR_TIMEOUT); | 1571 | NULL, 0, WDR_TIMEOUT); |
1573 | if (rv < 0) { | 1572 | if (rv < 0) { |
1574 | dbg("Unable to write event character: %i", rv); | 1573 | dev_dbg(&port->dev, "Unable to write event character: %i\n", rv); |
1575 | return -EIO; | 1574 | return -EIO; |
1576 | } | 1575 | } |
1577 | 1576 | ||
@@ -1590,7 +1589,7 @@ static int create_sysfs_attrs(struct usb_serial_port *port) | |||
1590 | /* XXX I've no idea if the original SIO supports the event_char | 1589 | /* XXX I've no idea if the original SIO supports the event_char |
1591 | * sysfs parameter, so I'm playing it safe. */ | 1590 | * sysfs parameter, so I'm playing it safe. */ |
1592 | if (priv->chip_type != SIO) { | 1591 | if (priv->chip_type != SIO) { |
1593 | dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]); | 1592 | dev_dbg(&port->dev, "sysfs attributes for %s\n", ftdi_chip_name[priv->chip_type]); |
1594 | retval = device_create_file(&port->dev, &dev_attr_event_char); | 1593 | retval = device_create_file(&port->dev, &dev_attr_event_char); |
1595 | if ((!retval) && | 1594 | if ((!retval) && |
1596 | (priv->chip_type == FT232BM || | 1595 | (priv->chip_type == FT232BM || |
@@ -1730,8 +1729,8 @@ static int ftdi_NDI_device_setup(struct usb_serial *serial) | |||
1730 | if (latency > 99) | 1729 | if (latency > 99) |
1731 | latency = 99; | 1730 | latency = 99; |
1732 | 1731 | ||
1733 | dbg("%s setting NDI device latency to %d", __func__, latency); | 1732 | dev_dbg(&udev->dev, "%s setting NDI device latency to %d\n", __func__, latency); |
1734 | dev_info(&udev->dev, "NDI device with a latency value of %d", latency); | 1733 | dev_info(&udev->dev, "NDI device with a latency value of %d\n", latency); |
1735 | 1734 | ||
1736 | /* FIXME: errors are not returned */ | 1735 | /* FIXME: errors are not returned */ |
1737 | usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 1736 | usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
@@ -1949,7 +1948,7 @@ static int ftdi_process_packet(struct tty_struct *tty, | |||
1949 | char *ch; | 1948 | char *ch; |
1950 | 1949 | ||
1951 | if (len < 2) { | 1950 | if (len < 2) { |
1952 | dbg("malformed packet"); | 1951 | dev_dbg(&port->dev, "malformed packet\n"); |
1953 | return 0; | 1952 | return 0; |
1954 | } | 1953 | } |
1955 | 1954 | ||
@@ -2064,12 +2063,12 @@ static void ftdi_break_ctl(struct tty_struct *tty, int break_state) | |||
2064 | FTDI_SIO_SET_DATA_REQUEST_TYPE, | 2063 | FTDI_SIO_SET_DATA_REQUEST_TYPE, |
2065 | urb_value , priv->interface, | 2064 | urb_value , priv->interface, |
2066 | NULL, 0, WDR_TIMEOUT) < 0) { | 2065 | NULL, 0, WDR_TIMEOUT) < 0) { |
2067 | dev_err(&port->dev, "%s FAILED to enable/disable break state " | 2066 | dev_err(&port->dev, "%s FAILED to enable/disable break state (state was %d)\n", |
2068 | "(state was %d)\n", __func__, break_state); | 2067 | __func__, break_state); |
2069 | } | 2068 | } |
2070 | 2069 | ||
2071 | dbg("%s break state is %d - urb is %d", __func__, | 2070 | dev_dbg(&port->dev, "%s break state is %d - urb is %d\n", __func__, |
2072 | break_state, urb_value); | 2071 | break_state, urb_value); |
2073 | 2072 | ||
2074 | } | 2073 | } |
2075 | 2074 | ||
@@ -2081,6 +2080,7 @@ static void ftdi_set_termios(struct tty_struct *tty, | |||
2081 | struct usb_serial_port *port, struct ktermios *old_termios) | 2080 | struct usb_serial_port *port, struct ktermios *old_termios) |
2082 | { | 2081 | { |
2083 | struct usb_device *dev = port->serial->dev; | 2082 | struct usb_device *dev = port->serial->dev; |
2083 | struct device *ddev = &port->dev; | ||
2084 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 2084 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
2085 | struct ktermios *termios = tty->termios; | 2085 | struct ktermios *termios = tty->termios; |
2086 | unsigned int cflag = termios->c_cflag; | 2086 | unsigned int cflag = termios->c_cflag; |
@@ -2094,14 +2094,14 @@ static void ftdi_set_termios(struct tty_struct *tty, | |||
2094 | /* Force baud rate if this device requires it, unless it is set to | 2094 | /* Force baud rate if this device requires it, unless it is set to |
2095 | B0. */ | 2095 | B0. */ |
2096 | if (priv->force_baud && ((termios->c_cflag & CBAUD) != B0)) { | 2096 | if (priv->force_baud && ((termios->c_cflag & CBAUD) != B0)) { |
2097 | dbg("%s: forcing baud rate for this device", __func__); | 2097 | dev_dbg(ddev, "%s: forcing baud rate for this device\n", __func__); |
2098 | tty_encode_baud_rate(tty, priv->force_baud, | 2098 | tty_encode_baud_rate(tty, priv->force_baud, |
2099 | priv->force_baud); | 2099 | priv->force_baud); |
2100 | } | 2100 | } |
2101 | 2101 | ||
2102 | /* Force RTS-CTS if this device requires it. */ | 2102 | /* Force RTS-CTS if this device requires it. */ |
2103 | if (priv->force_rtscts) { | 2103 | if (priv->force_rtscts) { |
2104 | dbg("%s: forcing rtscts for this device", __func__); | 2104 | dev_dbg(ddev, "%s: forcing rtscts for this device\n", __func__); |
2105 | termios->c_cflag |= CRTSCTS; | 2105 | termios->c_cflag |= CRTSCTS; |
2106 | } | 2106 | } |
2107 | 2107 | ||
@@ -2143,10 +2143,16 @@ no_skip: | |||
2143 | } | 2143 | } |
2144 | if (cflag & CSIZE) { | 2144 | if (cflag & CSIZE) { |
2145 | switch (cflag & CSIZE) { | 2145 | switch (cflag & CSIZE) { |
2146 | case CS7: urb_value |= 7; dbg("Setting CS7"); break; | 2146 | case CS7: |
2147 | case CS8: urb_value |= 8; dbg("Setting CS8"); break; | 2147 | urb_value |= 7; |
2148 | dev_dbg(ddev, "Setting CS7\n"); | ||
2149 | break; | ||
2150 | case CS8: | ||
2151 | urb_value |= 8; | ||
2152 | dev_dbg(ddev, "Setting CS8\n"); | ||
2153 | break; | ||
2148 | default: | 2154 | default: |
2149 | dev_err(&port->dev, "CSIZE was set but not CS7-CS8\n"); | 2155 | dev_err(ddev, "CSIZE was set but not CS7-CS8\n"); |
2150 | } | 2156 | } |
2151 | } | 2157 | } |
2152 | 2158 | ||
@@ -2159,8 +2165,8 @@ no_skip: | |||
2159 | FTDI_SIO_SET_DATA_REQUEST_TYPE, | 2165 | FTDI_SIO_SET_DATA_REQUEST_TYPE, |
2160 | urb_value , priv->interface, | 2166 | urb_value , priv->interface, |
2161 | NULL, 0, WDR_SHORT_TIMEOUT) < 0) { | 2167 | NULL, 0, WDR_SHORT_TIMEOUT) < 0) { |
2162 | dev_err(&port->dev, "%s FAILED to set " | 2168 | dev_err(ddev, "%s FAILED to set databits/stopbits/parity\n", |
2163 | "databits/stopbits/parity\n", __func__); | 2169 | __func__); |
2164 | } | 2170 | } |
2165 | 2171 | ||
2166 | /* Now do the baudrate */ | 2172 | /* Now do the baudrate */ |
@@ -2172,8 +2178,7 @@ no_data_parity_stop_changes: | |||
2172 | FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, | 2178 | FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, |
2173 | 0, priv->interface, | 2179 | 0, priv->interface, |
2174 | NULL, 0, WDR_TIMEOUT) < 0) { | 2180 | NULL, 0, WDR_TIMEOUT) < 0) { |
2175 | dev_err(&port->dev, | 2181 | dev_err(ddev, "%s error from disable flowcontrol urb\n", |
2176 | "%s error from disable flowcontrol urb\n", | ||
2177 | __func__); | 2182 | __func__); |
2178 | } | 2183 | } |
2179 | /* Drop RTS and DTR */ | 2184 | /* Drop RTS and DTR */ |
@@ -2182,8 +2187,7 @@ no_data_parity_stop_changes: | |||
2182 | /* set the baudrate determined before */ | 2187 | /* set the baudrate determined before */ |
2183 | mutex_lock(&priv->cfg_lock); | 2188 | mutex_lock(&priv->cfg_lock); |
2184 | if (change_speed(tty, port)) | 2189 | if (change_speed(tty, port)) |
2185 | dev_err(&port->dev, "%s urb failed to set baudrate\n", | 2190 | dev_err(ddev, "%s urb failed to set baudrate\n", __func__); |
2186 | __func__); | ||
2187 | mutex_unlock(&priv->cfg_lock); | 2191 | mutex_unlock(&priv->cfg_lock); |
2188 | /* Ensure RTS and DTR are raised when baudrate changed from 0 */ | 2192 | /* Ensure RTS and DTR are raised when baudrate changed from 0 */ |
2189 | if (!old_termios || (old_termios->c_cflag & CBAUD) == B0) | 2193 | if (!old_termios || (old_termios->c_cflag & CBAUD) == B0) |
@@ -2194,17 +2198,15 @@ no_data_parity_stop_changes: | |||
2194 | /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ | 2198 | /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */ |
2195 | no_c_cflag_changes: | 2199 | no_c_cflag_changes: |
2196 | if (cflag & CRTSCTS) { | 2200 | if (cflag & CRTSCTS) { |
2197 | dbg("%s Setting to CRTSCTS flow control", __func__); | 2201 | dev_dbg(ddev, "%s Setting to CRTSCTS flow control\n", __func__); |
2198 | if (usb_control_msg(dev, | 2202 | if (usb_control_msg(dev, |
2199 | usb_sndctrlpipe(dev, 0), | 2203 | usb_sndctrlpipe(dev, 0), |
2200 | FTDI_SIO_SET_FLOW_CTRL_REQUEST, | 2204 | FTDI_SIO_SET_FLOW_CTRL_REQUEST, |
2201 | FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, | 2205 | FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, |
2202 | 0 , (FTDI_SIO_RTS_CTS_HS | priv->interface), | 2206 | 0 , (FTDI_SIO_RTS_CTS_HS | priv->interface), |
2203 | NULL, 0, WDR_TIMEOUT) < 0) { | 2207 | NULL, 0, WDR_TIMEOUT) < 0) { |
2204 | dev_err(&port->dev, | 2208 | dev_err(ddev, "urb failed to set to rts/cts flow control\n"); |
2205 | "urb failed to set to rts/cts flow control\n"); | ||
2206 | } | 2209 | } |
2207 | |||
2208 | } else { | 2210 | } else { |
2209 | /* | 2211 | /* |
2210 | * Xon/Xoff code | 2212 | * Xon/Xoff code |
@@ -2214,8 +2216,8 @@ no_c_cflag_changes: | |||
2214 | * code is executed. | 2216 | * code is executed. |
2215 | */ | 2217 | */ |
2216 | if (iflag & IXOFF) { | 2218 | if (iflag & IXOFF) { |
2217 | dbg("%s request to enable xonxoff iflag=%04x", | 2219 | dev_dbg(ddev, "%s request to enable xonxoff iflag=%04x\n", |
2218 | __func__, iflag); | 2220 | __func__, iflag); |
2219 | /* Try to enable the XON/XOFF on the ftdi_sio | 2221 | /* Try to enable the XON/XOFF on the ftdi_sio |
2220 | * Set the vstart and vstop -- could have been done up | 2222 | * Set the vstart and vstop -- could have been done up |
2221 | * above where a lot of other dereferencing is done but | 2223 | * above where a lot of other dereferencing is done but |
@@ -2240,18 +2242,16 @@ no_c_cflag_changes: | |||
2240 | /* else clause to only run if cflag ! CRTSCTS and iflag | 2242 | /* else clause to only run if cflag ! CRTSCTS and iflag |
2241 | * ! XOFF. CHECKME Assuming XON/XOFF handled by tty | 2243 | * ! XOFF. CHECKME Assuming XON/XOFF handled by tty |
2242 | * stack - not by device */ | 2244 | * stack - not by device */ |
2243 | dbg("%s Turning off hardware flow control", __func__); | 2245 | dev_dbg(ddev, "%s Turning off hardware flow control\n", __func__); |
2244 | if (usb_control_msg(dev, | 2246 | if (usb_control_msg(dev, |
2245 | usb_sndctrlpipe(dev, 0), | 2247 | usb_sndctrlpipe(dev, 0), |
2246 | FTDI_SIO_SET_FLOW_CTRL_REQUEST, | 2248 | FTDI_SIO_SET_FLOW_CTRL_REQUEST, |
2247 | FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, | 2249 | FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, |
2248 | 0, priv->interface, | 2250 | 0, priv->interface, |
2249 | NULL, 0, WDR_TIMEOUT) < 0) { | 2251 | NULL, 0, WDR_TIMEOUT) < 0) { |
2250 | dev_err(&port->dev, | 2252 | dev_err(ddev, "urb failed to clear flow control\n"); |
2251 | "urb failed to clear flow control\n"); | ||
2252 | } | 2253 | } |
2253 | } | 2254 | } |
2254 | |||
2255 | } | 2255 | } |
2256 | } | 2256 | } |
2257 | 2257 | ||
@@ -2345,7 +2345,7 @@ static int ftdi_ioctl(struct tty_struct *tty, | |||
2345 | struct async_icount cnow; | 2345 | struct async_icount cnow; |
2346 | struct async_icount cprev; | 2346 | struct async_icount cprev; |
2347 | 2347 | ||
2348 | dbg("%s cmd 0x%04x", __func__, cmd); | 2348 | dev_dbg(&port->dev, "%s cmd 0x%04x\n", __func__, cmd); |
2349 | 2349 | ||
2350 | /* Based on code from acm.c and others */ | 2350 | /* Based on code from acm.c and others */ |
2351 | switch (cmd) { | 2351 | switch (cmd) { |
@@ -2393,7 +2393,8 @@ static int ftdi_ioctl(struct tty_struct *tty, | |||
2393 | /* This is not necessarily an error - turns out the higher layers | 2393 | /* This is not necessarily an error - turns out the higher layers |
2394 | * will do some ioctls themselves (see comment above) | 2394 | * will do some ioctls themselves (see comment above) |
2395 | */ | 2395 | */ |
2396 | dbg("%s arg not supported - it was 0x%04x - check /usr/include/asm/ioctls.h", __func__, cmd); | 2396 | dev_dbg(&port->dev, "%s arg not supported - it was 0x%04x - check /usr/include/asm/ioctls.h\n", |
2397 | __func__, cmd); | ||
2397 | return -ENOIOCTLCMD; | 2398 | return -ENOIOCTLCMD; |
2398 | } | 2399 | } |
2399 | 2400 | ||