Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338547
b: refs/heads/master
c: 4f2ab88
h: refs/heads/master
i:
  338545: 08ec64d
  338543: ae27408
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Oct 30, 2012
1 parent 584979c commit 076336f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 487c151a4a8fd1ab68308102c215158c14ad7c23
refs/heads/master: 4f2ab8887479bef2204878ed6d633a515a3e6a0d
31 changes: 14 additions & 17 deletions trunk/drivers/usb/serial/cp210x.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
*/
static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *);
static void cp210x_close(struct usb_serial_port *);
static void cp210x_get_termios(struct tty_struct *,
struct usb_serial_port *port);
static void cp210x_get_termios(struct tty_struct *, struct usb_serial_port *);
static void cp210x_get_termios_port(struct usb_serial_port *port,
unsigned int *cflagp, unsigned int *baudp);
static void cp210x_change_speed(struct tty_struct *, struct usb_serial_port *,
Expand Down Expand Up @@ -169,7 +168,7 @@ struct cp210x_serial_private {
static struct usb_serial_driver cp210x_device = {
.driver = {
.owner = THIS_MODULE,
.name = "cp210x",
.name = "cp210x",
},
.id_table = id_table,
.num_ports = 1,
Expand All @@ -179,7 +178,7 @@ static struct usb_serial_driver cp210x_device = {
.close = cp210x_close,
.break_ctl = cp210x_break_ctl,
.set_termios = cp210x_set_termios,
.tiocmget = cp210x_tiocmget,
.tiocmget = cp210x_tiocmget,
.tiocmset = cp210x_tiocmset,
.attach = cp210x_startup,
.release = cp210x_release,
Expand Down Expand Up @@ -281,7 +280,7 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
int result, i, length;

/* Number of integers required to contain the array */
length = (((size - 1) | 3) + 1)/4;
length = (((size - 1) | 3) + 1) / 4;

buf = kcalloc(length, sizeof(__le32), GFP_KERNEL);
if (!buf) {
Expand Down Expand Up @@ -328,12 +327,11 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
int result, i, length;

/* Number of integers required to contain the array */
length = (((size - 1) | 3) + 1)/4;
length = (((size - 1) | 3) + 1) / 4;

buf = kmalloc(length * sizeof(__le32), GFP_KERNEL);
if (!buf) {
dev_err(&port->dev, "%s - out of memory.\n",
__func__);
dev_err(&port->dev, "%s - out of memory.\n", __func__);
return -ENOMEM;
}

Expand Down Expand Up @@ -384,7 +382,8 @@ static inline int cp210x_set_config_single(struct usb_serial_port *port,
* cp210x_quantise_baudrate
* Quantises the baud rate as per AN205 Table 1
*/
static unsigned int cp210x_quantise_baudrate(unsigned int baud) {
static unsigned int cp210x_quantise_baudrate(unsigned int baud)
{
if (baud <= 300)
baud = 300;
else if (baud <= 600) baud = 600;
Expand Down Expand Up @@ -467,9 +466,7 @@ static void cp210x_get_termios(struct tty_struct *tty,
cp210x_get_termios_port(tty->driver_data,
&tty->termios.c_cflag, &baud);
tty_encode_baud_rate(tty, baud, baud);
}

else {
} else {
unsigned int cflag;
cflag = 0;
cp210x_get_termios_port(port, &cflag, &baud);
Expand Down Expand Up @@ -693,8 +690,8 @@ static void cp210x_set_termios(struct tty_struct *tty,
break;*/
default:
dev_dbg(dev, "cp210x driver does not support the number of bits requested, using 8 bit mode\n");
bits |= BITS_DATA_8;
break;
bits |= BITS_DATA_8;
break;
}
if (cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2))
dev_dbg(dev, "Number of data bits requested not supported by device\n");
Expand Down Expand Up @@ -767,7 +764,7 @@ static void cp210x_set_termios(struct tty_struct *tty,

}

static int cp210x_tiocmset (struct tty_struct *tty,
static int cp210x_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{
struct usb_serial_port *port = tty->driver_data;
Expand Down Expand Up @@ -809,7 +806,7 @@ static void cp210x_dtr_rts(struct usb_serial_port *p, int on)
cp210x_tiocmset_port(p, 0, TIOCM_DTR|TIOCM_RTS);
}

static int cp210x_tiocmget (struct tty_struct *tty)
static int cp210x_tiocmget(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
unsigned int control;
Expand All @@ -829,7 +826,7 @@ static int cp210x_tiocmget (struct tty_struct *tty)
return result;
}

static void cp210x_break_ctl (struct tty_struct *tty, int break_state)
static void cp210x_break_ctl(struct tty_struct *tty, int break_state)
{
struct usb_serial_port *port = tty->driver_data;
unsigned int state;
Expand Down

0 comments on commit 076336f

Please sign in to comment.