diff options
author | Christoph Hellwig <hch@lst.de> | 2018-05-15 15:57:23 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 07:23:35 +0200 |
commit | 3f3942aca6da351a12543aa776467791b63b3a78 (patch) | |
tree | 31030e086ea36920e07078ea2289b9b72c0b2939 /drivers/char/ds1620.c | |
parent | 44414d82cfe0f68cb59d0a42f599ccd893ae0032 (diff) | |
download | linux-3f3942aca6da351a12543aa776467791b63b3a78.tar.gz linux-3f3942aca6da351a12543aa776467791b63b3a78.tar.bz2 linux-3f3942aca6da351a12543aa776467791b63b3a78.zip |
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/char/ds1620.c')
-rw-r--r-- | drivers/char/ds1620.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/char/ds1620.c b/drivers/char/ds1620.c index eb53cbadb68f..a5ecf6dae02e 100644 --- a/drivers/char/ds1620.c +++ b/drivers/char/ds1620.c @@ -345,18 +345,6 @@ static int ds1620_proc_therm_show(struct seq_file *m, void *v) fan_state[netwinder_get_fan()]); return 0; } - -static int ds1620_proc_therm_open(struct inode *inode, struct file *file) -{ - return single_open(file, ds1620_proc_therm_show, NULL); -} - -static const struct file_operations ds1620_proc_therm_fops = { - .open = ds1620_proc_therm_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; #endif static const struct file_operations ds1620_fops = { @@ -404,7 +392,7 @@ static int __init ds1620_init(void) return ret; #ifdef THERM_USE_PROC - if (!proc_create("therm", 0, NULL, &ds1620_proc_therm_fops)) + if (!proc_create_single("therm", 0, NULL, ds1620_proc_therm_show)) printk(KERN_ERR "therm: unable to register /proc/therm\n"); #endif |