Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

proc tty: remove struct tty_operations::read_proc

struct tty_operations::proc_fops took it's place and there is one less
create_proc_read_entry() user now!

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Alexey Dobriyan and committed by
Linus Torvalds
0f043a81 14071693

+4 -29
-7
drivers/isdn/capi/capi.c
··· 1331 1331 #endif 1332 1332 } 1333 1333 1334 - static int capinc_tty_read_proc(char *page, char **start, off_t off, 1335 - int count, int *eof, void *data) 1336 - { 1337 - return 0; 1338 - } 1339 - 1340 1334 static struct tty_driver *capinc_tty_driver; 1341 1335 1342 1336 static const struct tty_operations capinc_ops = { ··· 1352 1358 .flush_buffer = capinc_tty_flush_buffer, 1353 1359 .set_ldisc = capinc_tty_set_ldisc, 1354 1360 .send_xchar = capinc_tty_send_xchar, 1355 - .read_proc = capinc_tty_read_proc, 1356 1361 }; 1357 1362 1358 1363 static int capinc_tty_init(void)
+4 -14
fs/proc/proc_tty.c
··· 144 144 { 145 145 struct proc_dir_entry *ent; 146 146 147 - if (!driver->driver_name || driver->proc_entry) 147 + if (!driver->driver_name || driver->proc_entry || 148 + !driver->ops->proc_fops) 148 149 return; 149 150 150 - if (driver->ops->proc_fops) { 151 - ent = proc_create_data(driver->driver_name, 0, proc_tty_driver, 152 - driver->ops->proc_fops, driver); 153 - if (!ent) 154 - return; 155 - } else if (driver->ops->read_proc) { 156 - ent = create_proc_entry(driver->driver_name, 0, proc_tty_driver); 157 - if (!ent) 158 - return; 159 - ent->read_proc = driver->ops->read_proc; 160 - ent->data = driver; 161 - } else 162 - return; 151 + ent = proc_create_data(driver->driver_name, 0, proc_tty_driver, 152 + driver->ops->proc_fops, driver); 163 153 driver->proc_entry = ent; 164 154 } 165 155
-2
include/linux/tty_driver.h
··· 252 252 void (*set_ldisc)(struct tty_struct *tty); 253 253 void (*wait_until_sent)(struct tty_struct *tty, int timeout); 254 254 void (*send_xchar)(struct tty_struct *tty, char ch); 255 - int (*read_proc)(char *page, char **start, off_t off, 256 - int count, int *eof, void *data); 257 255 int (*tiocmget)(struct tty_struct *tty, struct file *file); 258 256 int (*tiocmset)(struct tty_struct *tty, struct file *file, 259 257 unsigned int set, unsigned int clear);
-6
net/bluetooth/rfcomm/tty.c
··· 1093 1093 } 1094 1094 } 1095 1095 1096 - static int rfcomm_tty_read_proc(char *buf, char **start, off_t offset, int len, int *eof, void *unused) 1097 - { 1098 - return 0; 1099 - } 1100 - 1101 1096 static int rfcomm_tty_tiocmget(struct tty_struct *tty, struct file *filp) 1102 1097 { 1103 1098 struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data; ··· 1151 1156 .send_xchar = rfcomm_tty_send_xchar, 1152 1157 .hangup = rfcomm_tty_hangup, 1153 1158 .wait_until_sent = rfcomm_tty_wait_until_sent, 1154 - .read_proc = rfcomm_tty_read_proc, 1155 1159 .tiocmget = rfcomm_tty_tiocmget, 1156 1160 .tiocmset = rfcomm_tty_tiocmset, 1157 1161 };