diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-04 10:00:01 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-04 10:00:01 -0700 |
commit | cf626b0da78df6669c6b5f51ddd9a70a0702e579 (patch) | |
tree | 45d29a4cb7574aed7f140814ed22088ded21c291 /drivers/usb | |
parent | 9c50eafc32ddbd166c8a2bbaecd4ad201c452b14 (diff) | |
parent | 5ef03dbd91855544cd4c7c1910c3ef5226ee87e8 (diff) |
Merge branch 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull procfs updates from Al Viro:
"Christoph's proc_create_... cleanups series"
* 'hch.procfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (44 commits)
xfs, proc: hide unused xfs procfs helpers
isdn/gigaset: add back gigaset_procinfo assignment
proc: update SIZEOF_PDE_INLINE_NAME for the new pde fields
tty: replace ->proc_fops with ->proc_show
ide: replace ->proc_fops with ->proc_show
ide: remove ide_driver_proc_write
isdn: replace ->proc_fops with ->proc_show
atm: switch to proc_create_seq_private
atm: simplify procfs code
bluetooth: switch to proc_create_seq_data
netfilter/x_tables: switch to proc_create_seq_private
netfilter/xt_hashlimit: switch to proc_create_{seq,single}_data
neigh: switch to proc_create_seq_data
hostap: switch to proc_create_{seq,single}_data
bonding: switch to proc_create_seq_data
rtc/proc: switch to proc_create_single_data
drbd: switch to proc_create_single
resource: switch to proc_create_seq_data
staging/rtl8192u: simplify procfs code
jfs: simplify procfs code
...
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/udc/at91_udc.c | 16 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/fsl_udc_core.c | 18 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/goku_udc.c | 18 | ||||
-rw-r--r-- | drivers/usb/gadget/udc/omap_udc.c | 15 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 15 |
5 files changed, 7 insertions, 75 deletions
diff --git a/drivers/usb/gadget/udc/at91_udc.c b/drivers/usb/gadget/udc/at91_udc.c index ad743a8493be..03959dc86cfd 100644 --- a/drivers/usb/gadget/udc/at91_udc.c +++ b/drivers/usb/gadget/udc/at91_udc.c @@ -234,22 +234,10 @@ static int proc_udc_show(struct seq_file *s, void *unused) return 0; } -static int proc_udc_open(struct inode *inode, struct file *file) -{ - return single_open(file, proc_udc_show, PDE_DATA(inode)); -} - -static const struct file_operations proc_ops = { - .owner = THIS_MODULE, - .open = proc_udc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - static void create_debug_file(struct at91_udc *udc) { - udc->pde = proc_create_data(debug_filename, 0, NULL, &proc_ops, udc); + udc->pde = proc_create_single_data(debug_filename, 0, NULL, + proc_udc_show, udc); } static void remove_debug_file(struct at91_udc *udc) diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index 56b517a38865..7d8af299dfc7 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -2207,22 +2207,8 @@ static int fsl_proc_read(struct seq_file *m, void *v) return 0; } -/* - * seq_file wrappers for procfile show routines. - */ -static int fsl_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, fsl_proc_read, NULL); -} - -static const struct file_operations fsl_proc_fops = { - .open = fsl_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -#define create_proc_file() proc_create(proc_filename, 0, NULL, &fsl_proc_fops) +#define create_proc_file() \ + proc_create_single(proc_filename, 0, NULL, fsl_proc_read) #define remove_proc_file() remove_proc_entry(proc_filename, NULL) #else /* !CONFIG_USB_GADGET_DEBUG_FILES */ diff --git a/drivers/usb/gadget/udc/goku_udc.c b/drivers/usb/gadget/udc/goku_udc.c index 4504d0b202db..c3721225b61e 100644 --- a/drivers/usb/gadget/udc/goku_udc.c +++ b/drivers/usb/gadget/udc/goku_udc.c @@ -1241,22 +1241,6 @@ done: local_irq_restore(flags); return 0; } - -/* - * seq_file wrappers for procfile show routines. - */ -static int udc_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, udc_proc_read, PDE_DATA(file_inode(file))); -} - -static const struct file_operations udc_proc_fops = { - .open = udc_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - #endif /* CONFIG_USB_GADGET_DEBUG_FILES */ /*-------------------------------------------------------------------------*/ @@ -1826,7 +1810,7 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id) #ifdef CONFIG_USB_GADGET_DEBUG_FILES - proc_create_data(proc_node_name, 0, NULL, &udc_proc_fops, dev); + proc_create_single_data(proc_node_name, 0, NULL, udc_proc_read, dev); #endif retval = usb_add_gadget_udc_release(&pdev->dev, &dev->gadget, diff --git a/drivers/usb/gadget/udc/omap_udc.c b/drivers/usb/gadget/udc/omap_udc.c index dc35a54bad90..3a16431da321 100644 --- a/drivers/usb/gadget/udc/omap_udc.c +++ b/drivers/usb/gadget/udc/omap_udc.c @@ -2432,22 +2432,9 @@ static int proc_udc_show(struct seq_file *s, void *_) return 0; } -static int proc_udc_open(struct inode *inode, struct file *file) -{ - return single_open(file, proc_udc_show, NULL); -} - -static const struct file_operations proc_ops = { - .owner = THIS_MODULE, - .open = proc_udc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - static void create_proc_file(void) { - proc_create(proc_filename, 0, NULL, &proc_ops); + proc_create_single(proc_filename, 0, NULL, proc_udc_show); } static void remove_proc_file(void) 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, }; |