cp2101: coding style

Bring up to coding style

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Alan Cox
2008-07-22 11:10:17 +01:00
committed by Linus Torvalds
parent c17ee88697
commit ff7eb60260
2 changed files with 156 additions and 160 deletions

View File

@@ -25,7 +25,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include <linux/usb.h> #include <linux/usb.h>
#include <asm/uaccess.h> #include <linux/uaccess.h>
#include <linux/usb/serial.h> #include <linux/usb/serial.h>
/* /*
@@ -406,16 +406,15 @@ static void cp2101_get_termios (struct tty_struct *tty)
cflag |= CS8; cflag |= CS8;
break; break;
case BITS_DATA_9: case BITS_DATA_9:
dbg("%s - data bits = 9 (not supported, " dbg("%s - data bits = 9 (not supported, using 8 data bits)",
"using 8 data bits)", __func__); __func__);
cflag |= CS8; cflag |= CS8;
bits &= ~BITS_DATA_MASK; bits &= ~BITS_DATA_MASK;
bits |= BITS_DATA_8; bits |= BITS_DATA_8;
cp2101_set_config(port, CP2101_BITS, &bits, 2); cp2101_set_config(port, CP2101_BITS, &bits, 2);
break; break;
default: default:
dbg("%s - Unknown number of data bits, " dbg("%s - Unknown number of data bits, using 8", __func__);
"using 8", __func__);
cflag |= CS8; cflag |= CS8;
bits &= ~BITS_DATA_MASK; bits &= ~BITS_DATA_MASK;
bits |= BITS_DATA_8; bits |= BITS_DATA_8;
@@ -438,22 +437,21 @@ static void cp2101_get_termios (struct tty_struct *tty)
cflag |= PARENB; cflag |= PARENB;
break; break;
case BITS_PARITY_MARK: case BITS_PARITY_MARK:
dbg("%s - parity = MARK (not supported, " dbg("%s - parity = MARK (not supported, disabling parity)",
"disabling parity)", __func__); __func__);
cflag &= ~PARENB; cflag &= ~PARENB;
bits &= ~BITS_PARITY_MASK; bits &= ~BITS_PARITY_MASK;
cp2101_set_config(port, CP2101_BITS, &bits, 2); cp2101_set_config(port, CP2101_BITS, &bits, 2);
break; break;
case BITS_PARITY_SPACE: case BITS_PARITY_SPACE:
dbg("%s - parity = SPACE (not supported, " dbg("%s - parity = SPACE (not supported, disabling parity)",
"disabling parity)", __func__); __func__);
cflag &= ~PARENB; cflag &= ~PARENB;
bits &= ~BITS_PARITY_MASK; bits &= ~BITS_PARITY_MASK;
cp2101_set_config(port, CP2101_BITS, &bits, 2); cp2101_set_config(port, CP2101_BITS, &bits, 2);
break; break;
default: default:
dbg("%s - Unknown parity mode, " dbg("%s - Unknown parity mode, disabling parity", __func__);
"disabling parity", __func__);
cflag &= ~PARENB; cflag &= ~PARENB;
bits &= ~BITS_PARITY_MASK; bits &= ~BITS_PARITY_MASK;
cp2101_set_config(port, CP2101_BITS, &bits, 2); cp2101_set_config(port, CP2101_BITS, &bits, 2);
@@ -466,8 +464,8 @@ static void cp2101_get_termios (struct tty_struct *tty)
dbg("%s - stop bits = 1", __func__); dbg("%s - stop bits = 1", __func__);
break; break;
case BITS_STOP_1_5: case BITS_STOP_1_5:
dbg("%s - stop bits = 1.5 (not supported, " dbg("%s - stop bits = 1.5 (not supported, using 1 stop bit)",
"using 1 stop bit)", __func__); __func__);
bits &= ~BITS_STOP_MASK; bits &= ~BITS_STOP_MASK;
cp2101_set_config(port, CP2101_BITS, &bits, 2); cp2101_set_config(port, CP2101_BITS, &bits, 2);
break; break;
@@ -476,8 +474,8 @@ static void cp2101_get_termios (struct tty_struct *tty)
cflag |= CSTOPB; cflag |= CSTOPB;
break; break;
default: default:
dbg("%s - Unknown number of stop bits, " dbg("%s - Unknown number of stop bits, using 1 stop bit",
"using 1 stop bit", __func__); __func__);
bits &= ~BITS_STOP_MASK; bits &= ~BITS_STOP_MASK;
cp2101_set_config(port, CP2101_BITS, &bits, 2); cp2101_set_config(port, CP2101_BITS, &bits, 2);
break; break;
@@ -732,10 +730,9 @@ static void cp2101_shutdown (struct usb_serial *serial)
dbg("%s", __func__); dbg("%s", __func__);
/* Stop reads and writes on all ports */ /* Stop reads and writes on all ports */
for (i=0; i < serial->num_ports; ++i) { for (i = 0; i < serial->num_ports; ++i)
cp2101_cleanup(serial->port[i]); cp2101_cleanup(serial->port[i]);
} }
}
static int __init cp2101_init(void) static int __init cp2101_init(void)
{ {

View File

@@ -646,7 +646,6 @@ static int whiteheat_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp) struct usb_serial_port *port, struct file *filp)
{ {
int retval = 0; int retval = 0;
struct ktermios old_term;
dbg("%s - port %d", __func__, port->number); dbg("%s - port %d", __func__, port->number);