summaryrefslogtreecommitdiff
path: root/drivers/media/pci/saa7164
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-05-15 15:57:23 +0200
committerChristoph Hellwig <hch@lst.de>2018-05-16 07:23:35 +0200
commit3f3942aca6da351a12543aa776467791b63b3a78 (patch)
tree31030e086ea36920e07078ea2289b9b72c0b2939 /drivers/media/pci/saa7164
parent44414d82cfe0f68cb59d0a42f599ccd893ae0032 (diff)
proc: introduce proc_create_single{,_data}
Variants of proc_create{,_data} that directly take a seq_file show callback and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/media/pci/saa7164')
-rw-r--r--drivers/media/pci/saa7164/saa7164-core.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c
index fca36a4910c2..d697e1ad929c 100644
--- a/drivers/media/pci/saa7164/saa7164-core.c
+++ b/drivers/media/pci/saa7164/saa7164-core.c
@@ -1122,23 +1122,11 @@ static int saa7164_proc_show(struct seq_file *m, void *v)
return 0;
}
-static int saa7164_proc_open(struct inode *inode, struct file *filp)
-{
- return single_open(filp, saa7164_proc_show, NULL);
-}
-
-static const struct file_operations saa7164_proc_fops = {
- .open = saa7164_proc_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
-
static int saa7164_proc_create(void)
{
struct proc_dir_entry *pe;
- pe = proc_create("saa7164", S_IRUGO, NULL, &saa7164_proc_fops);
+ pe = proc_create_single("saa7164", S_IRUGO, NULL, saa7164_proc_show);
if (!pe)
return -ENOMEM;