aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/mct_u232.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2007-07-26 14:01:10 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-30 16:27:46 -0400
commitf42449003114cc17cda0458c14f2deadfadf9f63 (patch)
treec2c1fc0e9daa69e7731c73c8f6dd8543c0c49425 /drivers/usb/serial/mct_u232.c
parentc6d61269f530e3f7da6bad32e8b42ab7993a5927 (diff)
USB: mct_u232: Convert to proper speed handling API
Signed-off-by: Alan Cox <alan@redhat.com> Acked-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/mct_u232.c')
-rw-r--r--drivers/usb/serial/mct_u232.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
index 2a3fabcf5186..e08c9bb403d8 100644
--- a/drivers/usb/serial/mct_u232.c
+++ b/drivers/usb/serial/mct_u232.c
@@ -184,21 +184,21 @@ struct mct_u232_private {
184 * we do not know how to support. We ignore them for the moment. 184 * we do not know how to support. We ignore them for the moment.
185 * XXX Rate-limit the error message, it's user triggerable. 185 * XXX Rate-limit the error message, it's user triggerable.
186 */ 186 */
187static int mct_u232_calculate_baud_rate(struct usb_serial *serial, int value) 187static int mct_u232_calculate_baud_rate(struct usb_serial *serial, speed_t value)
188{ 188{
189 if (le16_to_cpu(serial->dev->descriptor.idProduct) == MCT_U232_SITECOM_PID 189 if (le16_to_cpu(serial->dev->descriptor.idProduct) == MCT_U232_SITECOM_PID
190 || le16_to_cpu(serial->dev->descriptor.idProduct) == MCT_U232_BELKIN_F5U109_PID) { 190 || le16_to_cpu(serial->dev->descriptor.idProduct) == MCT_U232_BELKIN_F5U109_PID) {
191 switch (value) { 191 switch (value) {
192 case B300: return 0x01; 192 case 300: return 0x01;
193 case B600: return 0x02; /* this one not tested */ 193 case 600: return 0x02; /* this one not tested */
194 case B1200: return 0x03; 194 case 1200: return 0x03;
195 case B2400: return 0x04; 195 case 2400: return 0x04;
196 case B4800: return 0x06; 196 case 4800: return 0x06;
197 case B9600: return 0x08; 197 case 9600: return 0x08;
198 case B19200: return 0x09; 198 case 19200: return 0x09;
199 case B38400: return 0x0a; 199 case 38400: return 0x0a;
200 case B57600: return 0x0b; 200 case 57600: return 0x0b;
201 case B115200: return 0x0c; 201 case 115200: return 0x0c;
202 default: 202 default:
203 err("MCT USB-RS232: unsupported baudrate request 0x%x," 203 err("MCT USB-RS232: unsupported baudrate request 0x%x,"
204 " using default of B9600", value); 204 " using default of B9600", value);
@@ -206,27 +206,27 @@ static int mct_u232_calculate_baud_rate(struct usb_serial *serial, int value)
206 } 206 }
207 } else { 207 } else {
208 switch (value) { 208 switch (value) {
209 case B300: value = 300; break; 209 case 300: break;
210 case B600: value = 600; break; 210 case 600: break;
211 case B1200: value = 1200; break; 211 case 1200: break;
212 case B2400: value = 2400; break; 212 case 2400: break;
213 case B4800: value = 4800; break; 213 case 4800: break;
214 case B9600: value = 9600; break; 214 case 9600: break;
215 case B19200: value = 19200; break; 215 case 19200: break;
216 case B38400: value = 38400; break; 216 case 38400: break;
217 case B57600: value = 57600; break; 217 case 57600: break;
218 case B115200: value = 115200; break; 218 case 115200: break;
219 default: 219 default:
220 err("MCT USB-RS232: unsupported baudrate request 0x%x," 220 err("MCT USB-RS232: unsupported baudrate request 0x%x,"
221 " using default of B9600", value); 221 " using default of B9600", value);
222 value = 9600; 222 value = 9600;
223 } 223 }
224 return 115200/value; 224 return 115200/value;
225 } 225 }
226} 226}
227 227
228static int mct_u232_set_baud_rate(struct usb_serial *serial, struct usb_serial_port *port, 228static int mct_u232_set_baud_rate(struct usb_serial *serial, struct usb_serial_port *port,
229 int value) 229 speed_t value)
230{ 230{
231 __le32 divisor; 231 __le32 divisor;
232 int rc; 232 int rc;
@@ -634,7 +634,7 @@ static void mct_u232_set_termios (struct usb_serial_port *port,
634 mct_u232_set_modem_ctrl(serial, control_state); 634 mct_u232_set_modem_ctrl(serial, control_state);
635 } 635 }
636 636
637 mct_u232_set_baud_rate(serial, port, cflag & CBAUD); 637 mct_u232_set_baud_rate(serial, port, tty_get_baud_rate(port->tty));
638 638
639 if ((cflag & CBAUD) == B0 ) { 639 if ((cflag & CBAUD) == B0 ) {
640 dbg("%s: baud is B0", __FUNCTION__); 640 dbg("%s: baud is B0", __FUNCTION__);