Commit a509a7e4 authored by Alan Cox's avatar Alan Cox Committed by Live-CD User
Browse files

tty: USB does not need the filp argument in the drivers



And indeed none of them use it. Clean this up as it will make moving to a
standard open method rather easier.

Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d3b5cffc
......@@ -318,8 +318,7 @@ static void ark3116_set_termios(struct tty_struct *tty,
return;
}
static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port,
struct file *filp)
static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port)
{
struct ktermios tmp_termios;
struct usb_serial *serial = port->serial;
......@@ -334,7 +333,7 @@ static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port,
return -ENOMEM;
}
result = usb_serial_generic_open(tty, port, filp);
result = usb_serial_generic_open(tty, port);
if (result)
goto err_out;
......
......@@ -92,7 +92,7 @@ static int debug;
static int belkin_sa_startup(struct usb_serial *serial);
static void belkin_sa_release(struct usb_serial *serial);
static int belkin_sa_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp);
struct usb_serial_port *port);
static void belkin_sa_close(struct usb_serial_port *port);
static void belkin_sa_read_int_callback(struct urb *urb);
static void belkin_sa_set_termios(struct tty_struct *tty,
......@@ -213,7 +213,7 @@ static void belkin_sa_release(struct usb_serial *serial)
static int belkin_sa_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp)
struct usb_serial_port *port)
{
int retval = 0;
......
......@@ -300,8 +300,7 @@ static void ch341_close(struct usb_serial_port *port)
/* open this device, set default parameters */
static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port,
struct file *filp)
static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port)
{
struct usb_serial *serial = port->serial;
struct ch341_private *priv = usb_get_serial_port_data(serial->port[0]);
......@@ -333,7 +332,7 @@ static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port,
return -EPROTO;
}
r = usb_serial_generic_open(tty, port, filp);
r = usb_serial_generic_open(tty, port);
out: return r;
}
......
......@@ -150,9 +150,9 @@ static int usb_console_setup(struct console *co, char *options)
/* only call the device specific open if this
* is the first time the port is opened */
if (serial->type->open)
retval = serial->type->open(NULL, port, NULL);
retval = serial->type->open(NULL, port);
else
retval = usb_serial_generic_open(NULL, port, NULL);
retval = usb_serial_generic_open(NULL, port);
if (retval) {
err("could not open USB console port");
......
......@@ -33,8 +33,7 @@
/*
* Function Prototypes
*/
static int cp210x_open(struct tty_struct *, struct usb_serial_port *,
struct file *);
static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *);
static void cp210x_cleanup(struct usb_serial_port *);
static void cp210x_close(struct usb_serial_port *);
static void cp210x_get_termios(struct tty_struct *,
......@@ -368,8 +367,7 @@ static unsigned int cp210x_quantise_baudrate(unsigned int baud) {
return baud;
}
static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port,
struct file *filp)
static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
{
struct usb_serial *serial = port->serial;
int result;
......
......@@ -61,7 +61,7 @@ static int cyberjack_startup(struct usb_serial *serial);
static void cyberjack_disconnect(struct usb_serial *serial);
static void cyberjack_release(struct usb_serial *serial);
static int cyberjack_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp);
struct usb_serial_port *port);
static void cyberjack_close(struct usb_serial_port *port);
static int cyberjack_write(struct tty_struct *tty,
struct usb_serial_port *port, const unsigned char *buf, int count);
......@@ -173,7 +173,7 @@ static void cyberjack_release(struct usb_serial *serial)
}
static int cyberjack_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp)
struct usb_serial_port *port)
{
struct cyberjack_private *priv;
unsigned long flags;
......
......@@ -172,8 +172,7 @@ static int cypress_earthmate_startup(struct usb_serial *serial);
static int cypress_hidcom_startup(struct usb_serial *serial);
static int cypress_ca42v2_startup(struct usb_serial *serial);
static void cypress_release(struct usb_serial *serial);
static int cypress_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp);
static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port);
static void cypress_close(struct usb_serial_port *port);
static void cypress_dtr_rts(struct usb_serial_port *port, int on);
static int cypress_write(struct tty_struct *tty, struct usb_serial_port *port,
......@@ -633,8 +632,7 @@ static void cypress_release(struct usb_serial *serial)
}
static int cypress_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp)
static int cypress_open(struct tty_struct *tty, struct usb_serial_port *port)
{
struct cypress_private *priv = usb_get_serial_port_data(port);
struct usb_serial *serial = port->serial;
......
......@@ -453,8 +453,7 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
static void digi_write_bulk_callback(struct urb *urb);
static int digi_write_room(struct tty_struct *tty);
static int digi_chars_in_buffer(struct tty_struct *tty);
static int digi_open(struct tty_struct *tty, struct usb_serial_port *port,
struct file *filp);
static int digi_open(struct tty_struct *tty, struct usb_serial_port *port);
static void digi_close(struct usb_serial_port *port);
static int digi_carrier_raised(struct usb_serial_port *port);
static void digi_dtr_rts(struct usb_serial_port *port, int on);
......@@ -1347,8 +1346,7 @@ static int digi_carrier_raised(struct usb_serial_port *port)
return 0;
}
static int digi_open(struct tty_struct *tty, struct usb_serial_port *port,
struct file *filp)
static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)
{
int ret;
unsigned char buf[32];
......
......@@ -79,8 +79,7 @@ static int debug;
#define EMPEG_PRODUCT_ID 0x0001
/* function prototypes for an empeg-car player */
static int empeg_open(struct tty_struct *tty, struct usb_serial_port *port,
struct file *filp);
static int empeg_open(struct tty_struct *tty, struct usb_serial_port *port);
static void empeg_close(struct usb_serial_port *port);
static int empeg_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *buf,
......@@ -142,8 +141,7 @@ static int bytes_out;
/******************************************************************************
* Empeg specific driver functions
******************************************************************************/
static int empeg_open(struct tty_struct *tty, struct usb_serial_port *port,
struct file *filp)
static int empeg_open(struct tty_struct *tty,struct usb_serial_port *port)
{
struct usb_serial *serial = port->serial;
int result = 0;
......@@ -151,7 +149,7 @@ static int empeg_open(struct tty_struct *tty, struct usb_serial_port *port,
dbg("%s - port %d", __func__, port->number);
/* Force default termio settings */
empeg_set_termios(tty, port, NULL) ;
empeg_set_termios(tty, port, NULL);
bytes_in = 0;
bytes_out = 0;
......
......@@ -747,8 +747,7 @@ static int ftdi_sio_probe(struct usb_serial *serial,
const struct usb_device_id *id);
static int ftdi_sio_port_probe(struct usb_serial_port *port);
static int ftdi_sio_port_remove(struct usb_serial_port *port);
static int ftdi_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp);
static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port);
static void ftdi_close(struct usb_serial_port *port);
static void ftdi_dtr_rts(struct usb_serial_port *port, int on);
static int ftdi_write(struct tty_struct *tty, struct usb_serial_port *port,
......@@ -1680,8 +1679,7 @@ static int ftdi_sio_port_remove(struct usb_serial_port *port)
return 0;
}
static int ftdi_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp)
static int ftdi_open(struct tty_struct *tty, struct usb_serial_port *port)
{ /* ftdi_open */
struct usb_device *dev = port->serial->dev;
struct ftdi_private *priv = usb_get_serial_port_data(port);
......
......@@ -933,8 +933,7 @@ static int garmin_init_session(struct usb_serial_port *port)
static int garmin_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp)
static int garmin_open(struct tty_struct *tty, struct usb_serial_port *port)
{
unsigned long flags;
int status = 0;
......
......@@ -114,8 +114,7 @@ void usb_serial_generic_deregister(void)
#endif
}
int usb_serial_generic_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp)
int usb_serial_generic_open(struct tty_struct *tty, struct usb_serial_port *port)
{
struct usb_serial *serial = port->serial;
int result = 0;
......
......@@ -205,8 +205,7 @@ static void edge_bulk_out_data_callback(struct urb *urb);
static void edge_bulk_out_cmd_callback(struct urb *urb);
/* function prototypes for the usbserial callbacks */
static int edge_open(struct tty_struct *tty, struct usb_serial_port *port,
struct file *filp);
static int edge_open(struct tty_struct *tty, struct usb_serial_port *port);
static void edge_close(struct usb_serial_port *port);
static int edge_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *buf, int count);
......@@ -852,8 +851,7 @@ static void edge_bulk_out_cmd_callback(struct urb *urb)
* If successful, we return 0
* Otherwise we return a negative error number.
*****************************************************************************/
static int edge_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp)
static int edge_open(struct tty_struct *tty, struct usb_serial_port *port)
{
struct edgeport_port *edge_port = usb_get_serial_port_data(port);
struct usb_serial *serial;
......
......@@ -1831,8 +1831,7 @@ static void edge_bulk_out_callback(struct urb *urb)
tty_kref_put(tty);
}
static int edge_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp)
static int edge_open(struct tty_struct *tty, struct usb_serial_port *port)
{
struct edgeport_port *edge_port = usb_get_serial_port_data(port);
struct edgeport_serial *edge_serial;
......
......@@ -75,7 +75,7 @@ static int initial_wait;
/* Function prototypes for an ipaq */
static int ipaq_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp);
struct usb_serial_port *port);
static void ipaq_close(struct usb_serial_port *port);
static int ipaq_calc_num_ports(struct usb_serial *serial);
static int ipaq_startup(struct usb_serial *serial);
......@@ -587,7 +587,7 @@ static int bytes_in;
static int bytes_out;
static int ipaq_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp)
struct usb_serial_port *port)
{
struct usb_serial *serial = port->serial;
struct ipaq_private *priv;
......@@ -628,11 +628,6 @@ static int ipaq_open(struct tty_struct *tty,
priv->free_len += PACKET_SIZE;
}
if (tty) {
/* FIXME: These two are bogus */
tty->raw = 1;
tty->real_raw = 1;
}
/*
* Lose the small buffers usbserial provides. Make larger ones.
*/
......
......@@ -193,8 +193,7 @@ static void ipw_read_bulk_callback(struct urb *urb)
return;
}
static int ipw_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp)
static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port)
{
struct usb_device *dev = port->serial->dev;
u8 buf_flow_static[16] = IPW_BYTES_FLOWINIT;
......
......@@ -86,8 +86,7 @@ static int buffer_size;
static int xbof = -1;
static int ir_startup (struct usb_serial *serial);
static int ir_open(struct tty_struct *tty, struct usb_serial_port *port,
struct file *filep);
static int ir_open(struct tty_struct *tty, struct usb_serial_port *port);
static void ir_close(struct usb_serial_port *port);
static int ir_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *buf, int count);
......@@ -296,8 +295,7 @@ static int ir_startup(struct usb_serial *serial)
return 0;
}
static int ir_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp)
static int ir_open(struct tty_struct *tty, struct usb_serial_port *port)
{
char *buffer;
int result = 0;
......
......@@ -1018,8 +1018,7 @@ static void iuu_close(struct usb_serial_port *port)
}
}
static int iuu_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp)
static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port)
{
struct usb_serial *serial = port->serial;
u8 *buf;
......@@ -1077,7 +1076,7 @@ static int iuu_open(struct tty_struct *tty,
tty->termios->c_iflag = 0;
priv->termios_initialized = 1;
priv->poll = 0;
}
}
spin_unlock_irqrestore(&priv->lock, flags);
/* initialize writebuf */
......
......@@ -1209,8 +1209,7 @@ static int keyspan_write_room(struct tty_struct *tty)
}
static int keyspan_open(struct tty_struct *tty,
struct usb_serial_port *port, struct file *filp)
static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port)
{
struct keyspan_port_private *p_priv;
struct keyspan_serial_private *s_priv;
......
......@@ -36,8 +36,7 @@
/* Function prototypes for Keyspan serial converter */
static int keyspan_open (struct tty_struct *tty,
struct usb_serial_port *port,
struct file *filp);
struct usb_serial_port *port);
static void keyspan_close (struct usb_serial_port *port);
static void keyspan_dtr_rts (struct usb_serial_port *port, int on);
static int keyspan_startup (struct usb_serial *serial);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment