mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
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
@ -43,8 +43,10 @@
|
||||
#include <linux/usb/serial.h>
|
||||
|
||||
/* Function prototypes */
|
||||
static int option_open(struct tty_struct *tty, struct usb_serial_port *port, struct file *filp);
|
||||
static void option_close(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,
|
||||
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 void option_shutdown(struct usb_serial *serial);
|
||||
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);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
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 */
|
||||
for (j = 0; j < N_IN_URB; ++j) {
|
||||
portdata->in_urbs[j] = option_setup_urb(serial,
|
||||
port->bulk_in_endpointAddress, USB_DIR_IN, port,
|
||||
portdata->in_buffer[j], IN_BUFLEN, option_indat_callback);
|
||||
port->bulk_in_endpointAddress,
|
||||
USB_DIR_IN, port,
|
||||
portdata->in_buffer[j],
|
||||
IN_BUFLEN, option_indat_callback);
|
||||
}
|
||||
|
||||
/* outdat endpoints */
|
||||
for (j = 0; j < N_OUT_URB; ++j) {
|
||||
portdata->out_urbs[j] = option_setup_urb(serial,
|
||||
port->bulk_out_endpointAddress, USB_DIR_OUT, port,
|
||||
portdata->out_buffer[j], OUT_BUFLEN, option_outdat_callback);
|
||||
port->bulk_out_endpointAddress,
|
||||
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) {
|
||||
dbg("%s: kmalloc for option_port_private (%d) failed!.",
|
||||
__func__, i);
|
||||
return (1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
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",
|
||||
__func__, err);
|
||||
}
|
||||
|
||||
option_setup_urbs(serial);
|
||||
|
||||
return (0);
|
||||
return 0;
|
||||
|
||||
bail_out_error2:
|
||||
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++) {
|
||||
if (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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user