Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a8dcabf authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

tty: replace ->proc_fops with ->proc_show



Just set up the show callback in the tty_operations, and use
proc_create_single_data to create the file without additional
boilerplace code.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent ec7d9c9c
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -435,19 +435,6 @@ static int rs_proc_show(struct seq_file *m, void *v)
	return 0;
}

static int rs_proc_open(struct inode *inode, struct file *file)
{
	return single_open(file, rs_proc_show, NULL);
}

static const struct file_operations rs_proc_fops = {
	.owner		= THIS_MODULE,
	.open		= rs_proc_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= single_release,
};

static const struct tty_operations hp_ops = {
	.open = rs_open,
	.close = rs_close,
@@ -462,7 +449,7 @@ static const struct tty_operations hp_ops = {
	.unthrottle = rs_unthrottle,
	.send_xchar = rs_send_xchar,
	.hangup = rs_hangup,
	.proc_fops = &rs_proc_fops,
	.proc_show = rs_proc_show,
};

static const struct tty_port_operations hp_port_ops = {
+1 −14
Original line number Diff line number Diff line
@@ -153,19 +153,6 @@ static int rs_proc_show(struct seq_file *m, void *v)
	return 0;
}

static int rs_proc_open(struct inode *inode, struct file *file)
{
	return single_open(file, rs_proc_show, NULL);
}

static const struct file_operations rs_proc_fops = {
	.owner		= THIS_MODULE,
	.open		= rs_proc_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= single_release,
};

static const struct tty_operations serial_ops = {
	.open = rs_open,
	.close = rs_close,
@@ -176,7 +163,7 @@ static const struct tty_operations serial_ops = {
	.chars_in_buffer = rs_chars_in_buffer,
	.hangup = rs_hangup,
	.wait_until_sent = rs_wait_until_sent,
	.proc_fops = &rs_proc_fops,
	.proc_show = rs_proc_show,
};

int __init rs_init(void)
+1 −14
Original line number Diff line number Diff line
@@ -2616,19 +2616,6 @@ static int mgslpc_proc_show(struct seq_file *m, void *v)
	return 0;
}

static int mgslpc_proc_open(struct inode *inode, struct file *file)
{
	return single_open(file, mgslpc_proc_show, NULL);
}

static const struct file_operations mgslpc_proc_fops = {
	.owner		= THIS_MODULE,
	.open		= mgslpc_proc_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= single_release,
};

static int rx_alloc_buffers(MGSLPC_INFO *info)
{
	/* each buffer has header and data */
@@ -2815,7 +2802,7 @@ static const struct tty_operations mgslpc_ops = {
	.tiocmget = tiocmget,
	.tiocmset = tiocmset,
	.get_icount = mgslpc_get_icount,
	.proc_fops = &mgslpc_proc_fops,
	.proc_show = mgslpc_proc_show,
};

static int __init synclink_cs_init(void)
+1 −14
Original line number Diff line number Diff line
@@ -1008,19 +1008,6 @@ static int sdio_uart_proc_show(struct seq_file *m, void *v)
	return 0;
}

static int sdio_uart_proc_open(struct inode *inode, struct file *file)
{
	return single_open(file, sdio_uart_proc_show, NULL);
}

static const struct file_operations sdio_uart_proc_fops = {
	.owner		= THIS_MODULE,
	.open		= sdio_uart_proc_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= single_release,
};

static const struct tty_port_operations sdio_uart_port_ops = {
	.dtr_rts = uart_dtr_rts,
	.carrier_raised = uart_carrier_raised,
@@ -1045,7 +1032,7 @@ static const struct tty_operations sdio_uart_ops = {
	.tiocmset		= sdio_uart_tiocmset,
	.install		= sdio_uart_install,
	.cleanup		= sdio_uart_cleanup,
	.proc_fops		= &sdio_uart_proc_fops,
	.proc_show		= sdio_uart_proc_show,
};

static struct tty_driver *sdio_uart_tty_driver;
+1 −14
Original line number Diff line number Diff line
@@ -1506,11 +1506,6 @@ static int fwtty_debugfs_peers_show(struct seq_file *m, void *v)
	return 0;
}

static int fwtty_proc_open(struct inode *inode, struct file *fp)
{
	return single_open(fp, fwtty_proc_show, NULL);
}

static int fwtty_stats_open(struct inode *inode, struct file *fp)
{
	return single_open(fp, fwtty_debugfs_stats_show, inode->i_private);
@@ -1537,14 +1532,6 @@ static const struct file_operations fwtty_peers_fops = {
	.release =	single_release,
};

static const struct file_operations fwtty_proc_fops = {
	.owner =        THIS_MODULE,
	.open =         fwtty_proc_open,
	.read =         seq_read,
	.llseek =       seq_lseek,
	.release =      single_release,
};

static const struct tty_port_operations fwtty_port_ops = {
	.dtr_rts =		fwtty_port_dtr_rts,
	.carrier_raised =	fwtty_port_carrier_raised,
@@ -1570,7 +1557,7 @@ static const struct tty_operations fwtty_ops = {
	.tiocmget =		fwtty_tiocmget,
	.tiocmset =		fwtty_tiocmset,
	.get_icount =		fwtty_get_icount,
	.proc_fops =		&fwtty_proc_fops,
	.proc_show =		fwtty_proc_show,
};

static const struct tty_operations fwloop_ops = {
Loading