Skip to content

Commit

Permalink
tiocmget: kill off the passing of the struct file
Browse files Browse the repository at this point in the history
We don't actually need this and it causes problems for internal use of
this functionality. Currently there is a single use of the FILE * pointer.
That is the serial core which uses it to check tty_hung_up_p. However if
that is true then IO_ERROR is also already set so the check may be removed.

Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Alan Cox authored and gregkh committed Feb 17, 2011
1 parent adf9251 commit 60b33c1
Show file tree
Hide file tree
Showing 69 changed files with 98 additions and 101 deletions.
2 changes: 1 addition & 1 deletion drivers/char/amiserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ static int get_lsr_info(struct async_struct * info, unsigned int __user *value)
}


static int rs_tiocmget(struct tty_struct *tty, struct file *file)
static int rs_tiocmget(struct tty_struct *tty)
{
struct async_struct * info = tty->driver_data;
unsigned char control, status;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/cyclades.c
Original file line number Diff line number Diff line change
Expand Up @@ -2429,7 +2429,7 @@ static int get_lsr_info(struct cyclades_port *info, unsigned int __user *value)
return put_user(result, (unsigned long __user *)value);
}

static int cy_tiocmget(struct tty_struct *tty, struct file *file)
static int cy_tiocmget(struct tty_struct *tty)
{
struct cyclades_port *info = tty->driver_data;
struct cyclades_card *card;
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/epca.c
Original file line number Diff line number Diff line change
Expand Up @@ -1982,7 +1982,7 @@ static int info_ioctl(struct tty_struct *tty, struct file *file,
return 0;
}

static int pc_tiocmget(struct tty_struct *tty, struct file *file)
static int pc_tiocmget(struct tty_struct *tty)
{
struct channel *ch = tty->driver_data;
struct board_chan __iomem *bc;
Expand Down Expand Up @@ -2074,7 +2074,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file,
return -EINVAL;
switch (cmd) {
case TIOCMODG:
mflag = pc_tiocmget(tty, file);
mflag = pc_tiocmget(tty);
if (put_user(mflag, (unsigned long __user *)argp))
return -EFAULT;
break;
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/ip2/ip2main.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static void ip2_unthrottle(PTTY);
static void ip2_stop(PTTY);
static void ip2_start(PTTY);
static void ip2_hangup(PTTY);
static int ip2_tiocmget(struct tty_struct *tty, struct file *file);
static int ip2_tiocmget(struct tty_struct *tty);
static int ip2_tiocmset(struct tty_struct *tty, struct file *file,
unsigned int set, unsigned int clear);
static int ip2_get_icount(struct tty_struct *tty,
Expand Down Expand Up @@ -2038,7 +2038,7 @@ ip2_stop ( PTTY tty )
/* Device Ioctl Section */
/******************************************************************************/

static int ip2_tiocmget(struct tty_struct *tty, struct file *file)
static int ip2_tiocmget(struct tty_struct *tty)
{
i2ChanStrPtr pCh = DevTable[tty->index];
#ifdef ENABLE_DSSNOW
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/isicom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ static int isicom_send_break(struct tty_struct *tty, int length)
return 0;
}

static int isicom_tiocmget(struct tty_struct *tty, struct file *file)
static int isicom_tiocmget(struct tty_struct *tty)
{
struct isi_port *port = tty->driver_data;
/* just send the port status */
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/istallion.c
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ static int stli_setserial(struct tty_struct *tty, struct serial_struct __user *s

/*****************************************************************************/

static int stli_tiocmget(struct tty_struct *tty, struct file *file)
static int stli_tiocmget(struct tty_struct *tty)
{
struct stliport *portp = tty->driver_data;
struct stlibrd *brdp;
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/moxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ static void moxa_set_termios(struct tty_struct *, struct ktermios *);
static void moxa_stop(struct tty_struct *);
static void moxa_start(struct tty_struct *);
static void moxa_hangup(struct tty_struct *);
static int moxa_tiocmget(struct tty_struct *tty, struct file *file);
static int moxa_tiocmget(struct tty_struct *tty);
static int moxa_tiocmset(struct tty_struct *tty, struct file *file,
unsigned int set, unsigned int clear);
static void moxa_poll(unsigned long);
Expand Down Expand Up @@ -1257,7 +1257,7 @@ static int moxa_chars_in_buffer(struct tty_struct *tty)
return chars;
}

static int moxa_tiocmget(struct tty_struct *tty, struct file *file)
static int moxa_tiocmget(struct tty_struct *tty)
{
struct moxa_port *ch = tty->driver_data;
int flag = 0, dtr, rts;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/mxser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ static int mxser_get_lsr_info(struct mxser_port *info,
return put_user(result, value);
}

static int mxser_tiocmget(struct tty_struct *tty, struct file *file)
static int mxser_tiocmget(struct tty_struct *tty)
{
struct mxser_port *info = tty->driver_data;
unsigned char control, status;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/nozomi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,7 @@ static int ntty_write_room(struct tty_struct *tty)
}

/* Gets io control parameters */
static int ntty_tiocmget(struct tty_struct *tty, struct file *file)
static int ntty_tiocmget(struct tty_struct *tty)
{
const struct port *port = tty->driver_data;
const struct ctrl_dl *ctrl_dl = &port->ctrl_dl;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/pcmcia/ipwireless/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static int set_control_lines(struct ipw_tty *tty, unsigned int set,
return 0;
}

static int ipw_tiocmget(struct tty_struct *linux_tty, struct file *file)
static int ipw_tiocmget(struct tty_struct *linux_tty)
{
struct ipw_tty *tty = linux_tty->driver_data;
/* FIXME: Exactly how is the tty object locked here .. */
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/pcmcia/synclink_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ static void bh_status(MGSLPC_INFO *info);
/*
* ioctl handlers
*/
static int tiocmget(struct tty_struct *tty, struct file *file);
static int tiocmget(struct tty_struct *tty);
static int tiocmset(struct tty_struct *tty, struct file *file,
unsigned int set, unsigned int clear);
static int get_stats(MGSLPC_INFO *info, struct mgsl_icount __user *user_icount);
Expand Down Expand Up @@ -2114,7 +2114,7 @@ static int modem_input_wait(MGSLPC_INFO *info,int arg)

/* return the state of the serial control and status signals
*/
static int tiocmget(struct tty_struct *tty, struct file *file)
static int tiocmget(struct tty_struct *tty)
{
MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
unsigned int result;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/riscom8.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ static int rc_chars_in_buffer(struct tty_struct *tty)
return port->xmit_cnt;
}

static int rc_tiocmget(struct tty_struct *tty, struct file *file)
static int rc_tiocmget(struct tty_struct *tty)
{
struct riscom_port *port = tty->driver_data;
struct riscom_board *bp;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/rocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ static int sGetChanRI(CHANNEL_T * ChP)
* Returns the state of the serial modem control lines. These next 2 functions
* are the way kernel versions > 2.5 handle modem control lines rather than IOCTLs.
*/
static int rp_tiocmget(struct tty_struct *tty, struct file *file)
static int rp_tiocmget(struct tty_struct *tty)
{
struct r_port *info = tty->driver_data;
unsigned int control, result, ChanStatus;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/serial167.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ set_serial_info(struct cyclades_port *info,
return startup(info);
} /* set_serial_info */

static int cy_tiocmget(struct tty_struct *tty, struct file *file)
static int cy_tiocmget(struct tty_struct *tty)
{
struct cyclades_port *info = tty->driver_data;
int channel;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/specialix.c
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ static int sx_chars_in_buffer(struct tty_struct *tty)
return port->xmit_cnt;
}

static int sx_tiocmget(struct tty_struct *tty, struct file *file)
static int sx_tiocmget(struct tty_struct *tty)
{
struct specialix_port *port = tty->driver_data;
struct specialix_board *bp;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/stallion.c
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ static int stl_setserial(struct tty_struct *tty, struct serial_struct __user *sp

/*****************************************************************************/

static int stl_tiocmget(struct tty_struct *tty, struct file *file)
static int stl_tiocmget(struct tty_struct *tty)
{
struct stlport *portp;

Expand Down
2 changes: 1 addition & 1 deletion drivers/char/sx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,7 @@ static int sx_break(struct tty_struct *tty, int flag)
return 0;
}

static int sx_tiocmget(struct tty_struct *tty, struct file *file)
static int sx_tiocmget(struct tty_struct *tty)
{
struct sx_port *port = tty->driver_data;
return sx_getsignals(port);
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/synclink.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ static isr_dispatch_func UscIsrTable[7] =
/*
* ioctl call handlers
*/
static int tiocmget(struct tty_struct *tty, struct file *file);
static int tiocmget(struct tty_struct *tty);
static int tiocmset(struct tty_struct *tty, struct file *file,
unsigned int set, unsigned int clear);
static int mgsl_get_stats(struct mgsl_struct * info, struct mgsl_icount
Expand Down Expand Up @@ -2846,7 +2846,7 @@ static int modem_input_wait(struct mgsl_struct *info,int arg)

/* return the state of the serial control and status signals
*/
static int tiocmget(struct tty_struct *tty, struct file *file)
static int tiocmget(struct tty_struct *tty)
{
struct mgsl_struct *info = tty->driver_data;
unsigned int result;
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/synclink_gt.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static int tx_abort(struct slgt_info *info);
static int rx_enable(struct slgt_info *info, int enable);
static int modem_input_wait(struct slgt_info *info,int arg);
static int wait_mgsl_event(struct slgt_info *info, int __user *mask_ptr);
static int tiocmget(struct tty_struct *tty, struct file *file);
static int tiocmget(struct tty_struct *tty);
static int tiocmset(struct tty_struct *tty, struct file *file,
unsigned int set, unsigned int clear);
static int set_break(struct tty_struct *tty, int break_state);
Expand Down Expand Up @@ -3195,7 +3195,7 @@ static int modem_input_wait(struct slgt_info *info,int arg)
/*
* return state of serial control and status signals
*/
static int tiocmget(struct tty_struct *tty, struct file *file)
static int tiocmget(struct tty_struct *tty)
{
struct slgt_info *info = tty->driver_data;
unsigned int result;
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/synclinkmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ static int tx_abort(SLMP_INFO *info);
static int rx_enable(SLMP_INFO *info, int enable);
static int modem_input_wait(SLMP_INFO *info,int arg);
static int wait_mgsl_event(SLMP_INFO *info, int __user *mask_ptr);
static int tiocmget(struct tty_struct *tty, struct file *file);
static int tiocmget(struct tty_struct *tty);
static int tiocmset(struct tty_struct *tty, struct file *file,
unsigned int set, unsigned int clear);
static int set_break(struct tty_struct *tty, int break_state);
Expand Down Expand Up @@ -3207,7 +3207,7 @@ static int modem_input_wait(SLMP_INFO *info,int arg)

/* return the state of the serial control and status signals
*/
static int tiocmget(struct tty_struct *tty, struct file *file)
static int tiocmget(struct tty_struct *tty)
{
SLMP_INFO *info = tty->driver_data;
unsigned int result;
Expand Down
4 changes: 2 additions & 2 deletions drivers/isdn/gigaset/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static int if_chars_in_buffer(struct tty_struct *tty);
static void if_throttle(struct tty_struct *tty);
static void if_unthrottle(struct tty_struct *tty);
static void if_set_termios(struct tty_struct *tty, struct ktermios *old);
static int if_tiocmget(struct tty_struct *tty, struct file *file);
static int if_tiocmget(struct tty_struct *tty);
static int if_tiocmset(struct tty_struct *tty, struct file *file,
unsigned int set, unsigned int clear);
static int if_write(struct tty_struct *tty,
Expand Down Expand Up @@ -280,7 +280,7 @@ static int if_ioctl(struct tty_struct *tty, struct file *file,
return retval;
}

static int if_tiocmget(struct tty_struct *tty, struct file *file)
static int if_tiocmget(struct tty_struct *tty)
{
struct cardstate *cs;
int retval;
Expand Down
2 changes: 1 addition & 1 deletion drivers/isdn/i4l/isdn_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@ isdn_tty_get_lsr_info(modem_info * info, uint __user * value)


static int
isdn_tty_tiocmget(struct tty_struct *tty, struct file *file)
isdn_tty_tiocmget(struct tty_struct *tty)
{
modem_info *info = (modem_info *) tty->driver_data;
u_char control, status;
Expand Down
2 changes: 1 addition & 1 deletion drivers/mmc/card/sdio_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ static int sdio_uart_break_ctl(struct tty_struct *tty, int break_state)
return 0;
}

static int sdio_uart_tiocmget(struct tty_struct *tty, struct file *file)
static int sdio_uart_tiocmget(struct tty_struct *tty)
{
struct sdio_uart_port *port = tty->driver_data;
int result;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/hso.c
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ static int hso_get_count(struct tty_struct *tty,
}


static int hso_serial_tiocmget(struct tty_struct *tty, struct file *file)
static int hso_serial_tiocmget(struct tty_struct *tty)
{
int retval;
struct hso_serial *serial = get_serial_by_tty(tty);
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wan/pc300_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static void cpc_tty_signal_on(pc300dev_t *pc300dev, unsigned char);

static int pc300_tiocmset(struct tty_struct *, struct file *,
unsigned int, unsigned int);
static int pc300_tiocmget(struct tty_struct *, struct file *);
static int pc300_tiocmget(struct tty_struct *);

/* functions called by PC300 driver */
void cpc_tty_init(pc300dev_t *dev);
Expand Down Expand Up @@ -570,7 +570,7 @@ static int pc300_tiocmset(struct tty_struct *tty, struct file *file,
return 0;
}

static int pc300_tiocmget(struct tty_struct *tty, struct file *file)
static int pc300_tiocmget(struct tty_struct *tty)
{
unsigned int result;
unsigned char status;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/quatech_usb2/quatech_usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ static void qt2_set_termios(struct tty_struct *tty,
}
}

static int qt2_tiocmget(struct tty_struct *tty, struct file *file)
static int qt2_tiocmget(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
struct usb_serial *serial = port->serial;
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/serqt_usb2/serqt_usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ static void qt_break(struct tty_struct *tty, int break_state)

static inline int qt_real_tiocmget(struct tty_struct *tty,
struct usb_serial_port *port,
struct file *file, struct usb_serial *serial)
struct usb_serial *serial)
{

u8 mcr;
Expand Down Expand Up @@ -1462,7 +1462,7 @@ static inline int qt_real_tiocmset(struct tty_struct *tty,
return 0;
}

static int qt_tiocmget(struct tty_struct *tty, struct file *file)
static int qt_tiocmget(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
struct usb_serial *serial = get_usb_serial(port, __func__);
Expand All @@ -1480,7 +1480,7 @@ static int qt_tiocmget(struct tty_struct *tty, struct file *file)
dbg("%s - port %d\n", __func__, port->number);
dbg("%s - port->RxHolding = %d\n", __func__, qt_port->RxHolding);

retval = qt_real_tiocmget(tty, port, file, serial);
retval = qt_real_tiocmget(tty, port, serial);

spin_unlock_irqrestore(&qt_port->lock, flags);
return retval;
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/hvc/hvsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ static void hvsi_unthrottle(struct tty_struct *tty)
h_vio_signal(hp->vtermno, VIO_IRQ_ENABLE);
}

static int hvsi_tiocmget(struct tty_struct *tty, struct file *file)
static int hvsi_tiocmget(struct tty_struct *tty)
{
struct hvsi_struct *hp = tty->driver_data;

Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/n_gsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2648,7 +2648,7 @@ static void gsmtty_wait_until_sent(struct tty_struct *tty, int timeout)
to do here */
}

static int gsmtty_tiocmget(struct tty_struct *tty, struct file *filp)
static int gsmtty_tiocmget(struct tty_struct *tty)
{
struct gsm_dlci *dlci = tty->driver_data;
return dlci->modem_rx;
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/serial/68360serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ static int get_lsr_info(struct async_struct * info, unsigned int *value)
}
#endif

static int rs_360_tiocmget(struct tty_struct *tty, struct file *file)
static int rs_360_tiocmget(struct tty_struct *tty)
{
ser_info_t *info = (ser_info_t *)tty->driver_data;
unsigned int result = 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/serial/crisv10.c
Original file line number Diff line number Diff line change
Expand Up @@ -3614,7 +3614,7 @@ rs_tiocmset(struct tty_struct *tty, struct file *file,
}

static int
rs_tiocmget(struct tty_struct *tty, struct file *file)
rs_tiocmget(struct tty_struct *tty)
{
struct e100_serial *info = (struct e100_serial *)tty->driver_data;
unsigned int result;
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/serial/ifx6x60.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ static void ifx_spi_timeout(unsigned long arg)
* Map the signal state into Linux modem flags and report the value
* in Linux terms
*/
static int ifx_spi_tiocmget(struct tty_struct *tty, struct file *filp)
static int ifx_spi_tiocmget(struct tty_struct *tty)
{
unsigned int value;
struct ifx_spi_device *ifx_dev = tty->driver_data;
Expand Down
Loading

0 comments on commit 60b33c1

Please sign in to comment.