summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb-serial.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-04-13 21:04:45 +0200
committerChristoph Hellwig <hch@lst.de>2018-05-16 07:24:30 +0200
commit8a8dcabffb991a08fa1fab4e75b80a9075825606 (patch)
treedb9d836b96716c68104ab6c82d6a18912d0b3c84 /drivers/usb/serial/usb-serial.c
parentec7d9c9ce897174243af4fcd201dbfc34df0f3a3 (diff)
downloadlinux-8a8dcabffb991a08fa1fab4e75b80a9075825606.tar.bz2
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: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r--drivers/usb/serial/usb-serial.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 790e0cbe3da9..268ffa6b51d2 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -476,19 +476,6 @@ static int serial_proc_show(struct seq_file *m, void *v)
return 0;
}
-static int serial_proc_open(struct inode *inode, struct file *file)
-{
- return single_open(file, serial_proc_show, NULL);
-}
-
-static const struct file_operations serial_proc_fops = {
- .owner = THIS_MODULE,
- .open = serial_proc_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
-
static int serial_tiocmget(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
@@ -1192,7 +1179,7 @@ static const struct tty_operations serial_ops = {
.get_icount = serial_get_icount,
.cleanup = serial_cleanup,
.install = serial_install,
- .proc_fops = &serial_proc_fops,
+ .proc_show = serial_proc_show,
};