Skip to content

Commit 8a8dcab

Browse files
author
Christoph Hellwig
committed
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 <[email protected]>
1 parent ec7d9c9 commit 8a8dcab

File tree

14 files changed

+16
-172
lines changed

14 files changed

+16
-172
lines changed

arch/ia64/hp/sim/simserial.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -435,19 +435,6 @@ static int rs_proc_show(struct seq_file *m, void *v)
435435
return 0;
436436
}
437437

438-
static int rs_proc_open(struct inode *inode, struct file *file)
439-
{
440-
return single_open(file, rs_proc_show, NULL);
441-
}
442-
443-
static const struct file_operations rs_proc_fops = {
444-
.owner = THIS_MODULE,
445-
.open = rs_proc_open,
446-
.read = seq_read,
447-
.llseek = seq_lseek,
448-
.release = single_release,
449-
};
450-
451438
static const struct tty_operations hp_ops = {
452439
.open = rs_open,
453440
.close = rs_close,
@@ -462,7 +449,7 @@ static const struct tty_operations hp_ops = {
462449
.unthrottle = rs_unthrottle,
463450
.send_xchar = rs_send_xchar,
464451
.hangup = rs_hangup,
465-
.proc_fops = &rs_proc_fops,
452+
.proc_show = rs_proc_show,
466453
};
467454

468455
static const struct tty_port_operations hp_port_ops = {

arch/xtensa/platforms/iss/console.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,19 +153,6 @@ static int rs_proc_show(struct seq_file *m, void *v)
153153
return 0;
154154
}
155155

156-
static int rs_proc_open(struct inode *inode, struct file *file)
157-
{
158-
return single_open(file, rs_proc_show, NULL);
159-
}
160-
161-
static const struct file_operations rs_proc_fops = {
162-
.owner = THIS_MODULE,
163-
.open = rs_proc_open,
164-
.read = seq_read,
165-
.llseek = seq_lseek,
166-
.release = single_release,
167-
};
168-
169156
static const struct tty_operations serial_ops = {
170157
.open = rs_open,
171158
.close = rs_close,
@@ -176,7 +163,7 @@ static const struct tty_operations serial_ops = {
176163
.chars_in_buffer = rs_chars_in_buffer,
177164
.hangup = rs_hangup,
178165
.wait_until_sent = rs_wait_until_sent,
179-
.proc_fops = &rs_proc_fops,
166+
.proc_show = rs_proc_show,
180167
};
181168

182169
int __init rs_init(void)

drivers/char/pcmcia/synclink_cs.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2616,19 +2616,6 @@ static int mgslpc_proc_show(struct seq_file *m, void *v)
26162616
return 0;
26172617
}
26182618

2619-
static int mgslpc_proc_open(struct inode *inode, struct file *file)
2620-
{
2621-
return single_open(file, mgslpc_proc_show, NULL);
2622-
}
2623-
2624-
static const struct file_operations mgslpc_proc_fops = {
2625-
.owner = THIS_MODULE,
2626-
.open = mgslpc_proc_open,
2627-
.read = seq_read,
2628-
.llseek = seq_lseek,
2629-
.release = single_release,
2630-
};
2631-
26322619
static int rx_alloc_buffers(MGSLPC_INFO *info)
26332620
{
26342621
/* each buffer has header and data */
@@ -2815,7 +2802,7 @@ static const struct tty_operations mgslpc_ops = {
28152802
.tiocmget = tiocmget,
28162803
.tiocmset = tiocmset,
28172804
.get_icount = mgslpc_get_icount,
2818-
.proc_fops = &mgslpc_proc_fops,
2805+
.proc_show = mgslpc_proc_show,
28192806
};
28202807

28212808
static int __init synclink_cs_init(void)

drivers/mmc/core/sdio_uart.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,19 +1008,6 @@ static int sdio_uart_proc_show(struct seq_file *m, void *v)
10081008
return 0;
10091009
}
10101010

1011-
static int sdio_uart_proc_open(struct inode *inode, struct file *file)
1012-
{
1013-
return single_open(file, sdio_uart_proc_show, NULL);
1014-
}
1015-
1016-
static const struct file_operations sdio_uart_proc_fops = {
1017-
.owner = THIS_MODULE,
1018-
.open = sdio_uart_proc_open,
1019-
.read = seq_read,
1020-
.llseek = seq_lseek,
1021-
.release = single_release,
1022-
};
1023-
10241011
static const struct tty_port_operations sdio_uart_port_ops = {
10251012
.dtr_rts = uart_dtr_rts,
10261013
.carrier_raised = uart_carrier_raised,
@@ -1045,7 +1032,7 @@ static const struct tty_operations sdio_uart_ops = {
10451032
.tiocmset = sdio_uart_tiocmset,
10461033
.install = sdio_uart_install,
10471034
.cleanup = sdio_uart_cleanup,
1048-
.proc_fops = &sdio_uart_proc_fops,
1035+
.proc_show = sdio_uart_proc_show,
10491036
};
10501037

10511038
static struct tty_driver *sdio_uart_tty_driver;

drivers/staging/fwserial/fwserial.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,11 +1506,6 @@ static int fwtty_debugfs_peers_show(struct seq_file *m, void *v)
15061506
return 0;
15071507
}
15081508

1509-
static int fwtty_proc_open(struct inode *inode, struct file *fp)
1510-
{
1511-
return single_open(fp, fwtty_proc_show, NULL);
1512-
}
1513-
15141509
static int fwtty_stats_open(struct inode *inode, struct file *fp)
15151510
{
15161511
return single_open(fp, fwtty_debugfs_stats_show, inode->i_private);
@@ -1537,14 +1532,6 @@ static const struct file_operations fwtty_peers_fops = {
15371532
.release = single_release,
15381533
};
15391534

1540-
static const struct file_operations fwtty_proc_fops = {
1541-
.owner = THIS_MODULE,
1542-
.open = fwtty_proc_open,
1543-
.read = seq_read,
1544-
.llseek = seq_lseek,
1545-
.release = single_release,
1546-
};
1547-
15481535
static const struct tty_port_operations fwtty_port_ops = {
15491536
.dtr_rts = fwtty_port_dtr_rts,
15501537
.carrier_raised = fwtty_port_carrier_raised,
@@ -1570,7 +1557,7 @@ static const struct tty_operations fwtty_ops = {
15701557
.tiocmget = fwtty_tiocmget,
15711558
.tiocmset = fwtty_tiocmset,
15721559
.get_icount = fwtty_get_icount,
1573-
.proc_fops = &fwtty_proc_fops,
1560+
.proc_show = fwtty_proc_show,
15741561
};
15751562

15761563
static const struct tty_operations fwloop_ops = {

drivers/tty/amiserial.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,19 +1566,6 @@ static int rs_proc_show(struct seq_file *m, void *v)
15661566
return 0;
15671567
}
15681568

1569-
static int rs_proc_open(struct inode *inode, struct file *file)
1570-
{
1571-
return single_open(file, rs_proc_show, NULL);
1572-
}
1573-
1574-
static const struct file_operations rs_proc_fops = {
1575-
.owner = THIS_MODULE,
1576-
.open = rs_proc_open,
1577-
.read = seq_read,
1578-
.llseek = seq_lseek,
1579-
.release = single_release,
1580-
};
1581-
15821569
/*
15831570
* ---------------------------------------------------------------------
15841571
* rs_init() and friends
@@ -1620,7 +1607,7 @@ static const struct tty_operations serial_ops = {
16201607
.tiocmget = rs_tiocmget,
16211608
.tiocmset = rs_tiocmset,
16221609
.get_icount = rs_get_icount,
1623-
.proc_fops = &rs_proc_fops,
1610+
.proc_show = rs_proc_show,
16241611
};
16251612

16261613
static int amiga_carrier_raised(struct tty_port *port)

drivers/tty/cyclades.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3972,19 +3972,6 @@ static int cyclades_proc_show(struct seq_file *m, void *v)
39723972
return 0;
39733973
}
39743974

3975-
static int cyclades_proc_open(struct inode *inode, struct file *file)
3976-
{
3977-
return single_open(file, cyclades_proc_show, NULL);
3978-
}
3979-
3980-
static const struct file_operations cyclades_proc_fops = {
3981-
.owner = THIS_MODULE,
3982-
.open = cyclades_proc_open,
3983-
.read = seq_read,
3984-
.llseek = seq_lseek,
3985-
.release = single_release,
3986-
};
3987-
39883975
/* The serial driver boot-time initialization code!
39893976
Hardware I/O ports are mapped to character special devices on a
39903977
first found, first allocated manner. That is, this code searches
@@ -4024,7 +4011,7 @@ static const struct tty_operations cy_ops = {
40244011
.tiocmget = cy_tiocmget,
40254012
.tiocmset = cy_tiocmset,
40264013
.get_icount = cy_get_icount,
4027-
.proc_fops = &cyclades_proc_fops,
4014+
.proc_show = cyclades_proc_show,
40284015
};
40294016

40304017
static int __init cy_init(void)

drivers/tty/serial/serial_core.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,19 +1829,6 @@ static int uart_proc_show(struct seq_file *m, void *v)
18291829
uart_line_info(m, drv, i);
18301830
return 0;
18311831
}
1832-
1833-
static int uart_proc_open(struct inode *inode, struct file *file)
1834-
{
1835-
return single_open(file, uart_proc_show, PDE_DATA(inode));
1836-
}
1837-
1838-
static const struct file_operations uart_proc_fops = {
1839-
.owner = THIS_MODULE,
1840-
.open = uart_proc_open,
1841-
.read = seq_read,
1842-
.llseek = seq_lseek,
1843-
.release = single_release,
1844-
};
18451832
#endif
18461833

18471834
#if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(CONFIG_CONSOLE_POLL)
@@ -2415,7 +2402,7 @@ static const struct tty_operations uart_ops = {
24152402
.break_ctl = uart_break_ctl,
24162403
.wait_until_sent= uart_wait_until_sent,
24172404
#ifdef CONFIG_PROC_FS
2418-
.proc_fops = &uart_proc_fops,
2405+
.proc_show = uart_proc_show,
24192406
#endif
24202407
.tiocmget = uart_tiocmget,
24212408
.tiocmset = uart_tiocmset,

drivers/tty/synclink.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3534,19 +3534,6 @@ static int mgsl_proc_show(struct seq_file *m, void *v)
35343534
return 0;
35353535
}
35363536

3537-
static int mgsl_proc_open(struct inode *inode, struct file *file)
3538-
{
3539-
return single_open(file, mgsl_proc_show, NULL);
3540-
}
3541-
3542-
static const struct file_operations mgsl_proc_fops = {
3543-
.owner = THIS_MODULE,
3544-
.open = mgsl_proc_open,
3545-
.read = seq_read,
3546-
.llseek = seq_lseek,
3547-
.release = single_release,
3548-
};
3549-
35503537
/* mgsl_allocate_dma_buffers()
35513538
*
35523539
* Allocate and format DMA buffers (ISA adapter)
@@ -4298,7 +4285,7 @@ static const struct tty_operations mgsl_ops = {
42984285
.tiocmget = tiocmget,
42994286
.tiocmset = tiocmset,
43004287
.get_icount = msgl_get_icount,
4301-
.proc_fops = &mgsl_proc_fops,
4288+
.proc_show = mgsl_proc_show,
43024289
};
43034290

43044291
/*

drivers/tty/synclink_gt.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,19 +1316,6 @@ static int synclink_gt_proc_show(struct seq_file *m, void *v)
13161316
return 0;
13171317
}
13181318

1319-
static int synclink_gt_proc_open(struct inode *inode, struct file *file)
1320-
{
1321-
return single_open(file, synclink_gt_proc_show, NULL);
1322-
}
1323-
1324-
static const struct file_operations synclink_gt_proc_fops = {
1325-
.owner = THIS_MODULE,
1326-
.open = synclink_gt_proc_open,
1327-
.read = seq_read,
1328-
.llseek = seq_lseek,
1329-
.release = single_release,
1330-
};
1331-
13321319
/*
13331320
* return count of bytes in transmit buffer
13341321
*/
@@ -3721,7 +3708,7 @@ static const struct tty_operations ops = {
37213708
.tiocmget = tiocmget,
37223709
.tiocmset = tiocmset,
37233710
.get_icount = get_icount,
3724-
.proc_fops = &synclink_gt_proc_fops,
3711+
.proc_show = synclink_gt_proc_show,
37253712
};
37263713

37273714
static void slgt_cleanup(void)

0 commit comments

Comments
 (0)