aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-10-29 05:56:19 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-30 16:06:08 -0400
commit4f2ab8887479bef2204878ed6d633a515a3e6a0d (patch)
tree42640a619a07a25728fddca87d603ff6606dfd67 /drivers/usb/serial
parent487c151a4a8fd1ab68308102c215158c14ad7c23 (diff)
USB: cp210x: fix whitespace issues
Fix missing and superfluous whitespace. Fix misplaced brackets. Fix indentation. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/cp210x.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index eb033fc92a1..1264173a099 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -35,8 +35,7 @@
35 */ 35 */
36static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *); 36static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *);
37static void cp210x_close(struct usb_serial_port *); 37static void cp210x_close(struct usb_serial_port *);
38static void cp210x_get_termios(struct tty_struct *, 38static void cp210x_get_termios(struct tty_struct *, struct usb_serial_port *);
39 struct usb_serial_port *port);
40static void cp210x_get_termios_port(struct usb_serial_port *port, 39static void cp210x_get_termios_port(struct usb_serial_port *port,
41 unsigned int *cflagp, unsigned int *baudp); 40 unsigned int *cflagp, unsigned int *baudp);
42static void cp210x_change_speed(struct tty_struct *, struct usb_serial_port *, 41static void cp210x_change_speed(struct tty_struct *, struct usb_serial_port *,
@@ -169,7 +168,7 @@ struct cp210x_serial_private {
169static struct usb_serial_driver cp210x_device = { 168static struct usb_serial_driver cp210x_device = {
170 .driver = { 169 .driver = {
171 .owner = THIS_MODULE, 170 .owner = THIS_MODULE,
172 .name = "cp210x", 171 .name = "cp210x",
173 }, 172 },
174 .id_table = id_table, 173 .id_table = id_table,
175 .num_ports = 1, 174 .num_ports = 1,
@@ -179,7 +178,7 @@ static struct usb_serial_driver cp210x_device = {
179 .close = cp210x_close, 178 .close = cp210x_close,
180 .break_ctl = cp210x_break_ctl, 179 .break_ctl = cp210x_break_ctl,
181 .set_termios = cp210x_set_termios, 180 .set_termios = cp210x_set_termios,
182 .tiocmget = cp210x_tiocmget, 181 .tiocmget = cp210x_tiocmget,
183 .tiocmset = cp210x_tiocmset, 182 .tiocmset = cp210x_tiocmset,
184 .attach = cp210x_startup, 183 .attach = cp210x_startup,
185 .release = cp210x_release, 184 .release = cp210x_release,
@@ -281,7 +280,7 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
281 int result, i, length; 280 int result, i, length;
282 281
283 /* Number of integers required to contain the array */ 282 /* Number of integers required to contain the array */
284 length = (((size - 1) | 3) + 1)/4; 283 length = (((size - 1) | 3) + 1) / 4;
285 284
286 buf = kcalloc(length, sizeof(__le32), GFP_KERNEL); 285 buf = kcalloc(length, sizeof(__le32), GFP_KERNEL);
287 if (!buf) { 286 if (!buf) {
@@ -328,12 +327,11 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
328 int result, i, length; 327 int result, i, length;
329 328
330 /* Number of integers required to contain the array */ 329 /* Number of integers required to contain the array */
331 length = (((size - 1) | 3) + 1)/4; 330 length = (((size - 1) | 3) + 1) / 4;
332 331
333 buf = kmalloc(length * sizeof(__le32), GFP_KERNEL); 332 buf = kmalloc(length * sizeof(__le32), GFP_KERNEL);
334 if (!buf) { 333 if (!buf) {
335 dev_err(&port->dev, "%s - out of memory.\n", 334 dev_err(&port->dev, "%s - out of memory.\n", __func__);
336 __func__);
337 return -ENOMEM; 335 return -ENOMEM;
338 } 336 }
339 337
@@ -384,7 +382,8 @@ static inline int cp210x_set_config_single(struct usb_serial_port *port,
384 * cp210x_quantise_baudrate 382 * cp210x_quantise_baudrate
385 * Quantises the baud rate as per AN205 Table 1 383 * Quantises the baud rate as per AN205 Table 1
386 */ 384 */
387static unsigned int cp210x_quantise_baudrate(unsigned int baud) { 385static unsigned int cp210x_quantise_baudrate(unsigned int baud)
386{
388 if (baud <= 300) 387 if (baud <= 300)
389 baud = 300; 388 baud = 300;
390 else if (baud <= 600) baud = 600; 389 else if (baud <= 600) baud = 600;
@@ -467,9 +466,7 @@ static void cp210x_get_termios(struct tty_struct *tty,
467 cp210x_get_termios_port(tty->driver_data, 466 cp210x_get_termios_port(tty->driver_data,
468 &tty->termios.c_cflag, &baud); 467 &tty->termios.c_cflag, &baud);
469 tty_encode_baud_rate(tty, baud, baud); 468 tty_encode_baud_rate(tty, baud, baud);
470 } 469 } else {
471
472 else {
473 unsigned int cflag; 470 unsigned int cflag;
474 cflag = 0; 471 cflag = 0;
475 cp210x_get_termios_port(port, &cflag, &baud); 472 cp210x_get_termios_port(port, &cflag, &baud);
@@ -693,8 +690,8 @@ static void cp210x_set_termios(struct tty_struct *tty,
693 break;*/ 690 break;*/
694 default: 691 default:
695 dev_dbg(dev, "cp210x driver does not support the number of bits requested, using 8 bit mode\n"); 692 dev_dbg(dev, "cp210x driver does not support the number of bits requested, using 8 bit mode\n");
696 bits |= BITS_DATA_8; 693 bits |= BITS_DATA_8;
697 break; 694 break;
698 } 695 }
699 if (cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2)) 696 if (cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2))
700 dev_dbg(dev, "Number of data bits requested not supported by device\n"); 697 dev_dbg(dev, "Number of data bits requested not supported by device\n");
@@ -767,7 +764,7 @@ static void cp210x_set_termios(struct tty_struct *tty,
767 764
768} 765}
769 766
770static int cp210x_tiocmset (struct tty_struct *tty, 767static int cp210x_tiocmset(struct tty_struct *tty,
771 unsigned int set, unsigned int clear) 768 unsigned int set, unsigned int clear)
772{ 769{
773 struct usb_serial_port *port = tty->driver_data; 770 struct usb_serial_port *port = tty->driver_data;
@@ -809,7 +806,7 @@ static void cp210x_dtr_rts(struct usb_serial_port *p, int on)
809 cp210x_tiocmset_port(p, 0, TIOCM_DTR|TIOCM_RTS); 806 cp210x_tiocmset_port(p, 0, TIOCM_DTR|TIOCM_RTS);
810} 807}
811 808
812static int cp210x_tiocmget (struct tty_struct *tty) 809static int cp210x_tiocmget(struct tty_struct *tty)
813{ 810{
814 struct usb_serial_port *port = tty->driver_data; 811 struct usb_serial_port *port = tty->driver_data;
815 unsigned int control; 812 unsigned int control;
@@ -829,7 +826,7 @@ static int cp210x_tiocmget (struct tty_struct *tty)
829 return result; 826 return result;
830} 827}
831 828
832static void cp210x_break_ctl (struct tty_struct *tty, int break_state) 829static void cp210x_break_ctl(struct tty_struct *tty, int break_state)
833{ 830{
834 struct usb_serial_port *port = tty->driver_data; 831 struct usb_serial_port *port = tty->driver_data;
835 unsigned int state; 832 unsigned int state;