tty-usb-option: 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:
parent
2a77c81449
commit
19e58fae0c
1 changed files with 35 additions and 30 deletions
|
@ -43,8 +43,10 @@
|
||||||
#include <linux/usb/serial.h>
|
#include <linux/usb/serial.h>
|
||||||
|
|
||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
static int option_open(struct tty_struct *tty, struct usb_serial_port *port, struct file *filp);
|
static int option_open(struct tty_struct *tty, struct usb_serial_port *port,
|
||||||
static void option_close(struct tty_struct *tty, struct usb_serial_port *port, struct file *filp);
|
struct file *filp);
|
||||||
|
static void option_close(struct tty_struct *tty, struct usb_serial_port *port,
|
||||||
|
struct file *filp);
|
||||||
static int option_startup(struct usb_serial *serial);
|
static int option_startup(struct usb_serial *serial);
|
||||||
static void option_shutdown(struct usb_serial *serial);
|
static void option_shutdown(struct usb_serial *serial);
|
||||||
static int option_write_room(struct tty_struct *tty);
|
static int option_write_room(struct tty_struct *tty);
|
||||||
|
@ -726,7 +728,7 @@ static int option_open(struct tty_struct *tty,
|
||||||
|
|
||||||
option_send_setup(tty, port);
|
option_send_setup(tty, port);
|
||||||
|
|
||||||
return (0);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void option_close(struct tty_struct *tty,
|
static void option_close(struct tty_struct *tty,
|
||||||
|
@ -797,15 +799,19 @@ static void option_setup_urbs(struct usb_serial *serial)
|
||||||
/* Do indat endpoints first */
|
/* Do indat endpoints first */
|
||||||
for (j = 0; j < N_IN_URB; ++j) {
|
for (j = 0; j < N_IN_URB; ++j) {
|
||||||
portdata->in_urbs[j] = option_setup_urb(serial,
|
portdata->in_urbs[j] = option_setup_urb(serial,
|
||||||
port->bulk_in_endpointAddress, USB_DIR_IN, port,
|
port->bulk_in_endpointAddress,
|
||||||
portdata->in_buffer[j], IN_BUFLEN, option_indat_callback);
|
USB_DIR_IN, port,
|
||||||
|
portdata->in_buffer[j],
|
||||||
|
IN_BUFLEN, option_indat_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* outdat endpoints */
|
/* outdat endpoints */
|
||||||
for (j = 0; j < N_OUT_URB; ++j) {
|
for (j = 0; j < N_OUT_URB; ++j) {
|
||||||
portdata->out_urbs[j] = option_setup_urb(serial,
|
portdata->out_urbs[j] = option_setup_urb(serial,
|
||||||
port->bulk_out_endpointAddress, USB_DIR_OUT, port,
|
port->bulk_out_endpointAddress,
|
||||||
portdata->out_buffer[j], OUT_BUFLEN, option_outdat_callback);
|
USB_DIR_OUT, port,
|
||||||
|
portdata->out_buffer[j],
|
||||||
|
OUT_BUFLEN, option_outdat_callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -856,7 +862,7 @@ static int option_startup(struct usb_serial *serial)
|
||||||
if (!portdata) {
|
if (!portdata) {
|
||||||
dbg("%s: kmalloc for option_port_private (%d) failed!.",
|
dbg("%s: kmalloc for option_port_private (%d) failed!.",
|
||||||
__func__, i);
|
__func__, i);
|
||||||
return (1);
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (j = 0; j < N_IN_URB; j++) {
|
for (j = 0; j < N_IN_URB; j++) {
|
||||||
|
@ -882,10 +888,8 @@ static int option_startup(struct usb_serial *serial)
|
||||||
dbg("%s: submit irq_in urb failed %d",
|
dbg("%s: submit irq_in urb failed %d",
|
||||||
__func__, err);
|
__func__, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
option_setup_urbs(serial);
|
option_setup_urbs(serial);
|
||||||
|
return 0;
|
||||||
return (0);
|
|
||||||
|
|
||||||
bail_out_error2:
|
bail_out_error2:
|
||||||
for (j = 0; j < N_OUT_URB; j++)
|
for (j = 0; j < N_OUT_URB; j++)
|
||||||
|
@ -924,7 +928,8 @@ static void option_shutdown(struct usb_serial *serial)
|
||||||
for (j = 0; j < N_IN_URB; j++) {
|
for (j = 0; j < N_IN_URB; j++) {
|
||||||
if (portdata->in_urbs[j]) {
|
if (portdata->in_urbs[j]) {
|
||||||
usb_free_urb(portdata->in_urbs[j]);
|
usb_free_urb(portdata->in_urbs[j]);
|
||||||
free_page((unsigned long)portdata->in_buffer[j]);
|
free_page((unsigned long)
|
||||||
|
portdata->in_buffer[j]);
|
||||||
portdata->in_urbs[j] = NULL;
|
portdata->in_urbs[j] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue