diff options
author | Christoph Hellwig <hch@lst.de> | 2018-05-15 09:57:23 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 01:23:35 -0400 |
commit | 3f3942aca6da351a12543aa776467791b63b3a78 (patch) | |
tree | 31030e086ea36920e07078ea2289b9b72c0b2939 /drivers/input/misc | |
parent | 44414d82cfe0f68cb59d0a42f599ccd893ae0032 (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/input/misc')
-rw-r--r-- | drivers/input/misc/hp_sdc_rtc.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c index 49b34de0aed4..47eb8ca729fe 100644 --- a/drivers/input/misc/hp_sdc_rtc.c +++ b/drivers/input/misc/hp_sdc_rtc.c | |||
@@ -509,18 +509,6 @@ static int hp_sdc_rtc_proc_show(struct seq_file *m, void *v) | |||
509 | #undef NY | 509 | #undef NY |
510 | } | 510 | } |
511 | 511 | ||
512 | static int hp_sdc_rtc_proc_open(struct inode *inode, struct file *file) | ||
513 | { | ||
514 | return single_open(file, hp_sdc_rtc_proc_show, NULL); | ||
515 | } | ||
516 | |||
517 | static const struct file_operations hp_sdc_rtc_proc_fops = { | ||
518 | .open = hp_sdc_rtc_proc_open, | ||
519 | .read = seq_read, | ||
520 | .llseek = seq_lseek, | ||
521 | .release = single_release, | ||
522 | }; | ||
523 | |||
524 | static int hp_sdc_rtc_ioctl(struct file *file, | 512 | static int hp_sdc_rtc_ioctl(struct file *file, |
525 | unsigned int cmd, unsigned long arg) | 513 | unsigned int cmd, unsigned long arg) |
526 | { | 514 | { |
@@ -713,7 +701,7 @@ static int __init hp_sdc_rtc_init(void) | |||
713 | if (misc_register(&hp_sdc_rtc_dev) != 0) | 701 | if (misc_register(&hp_sdc_rtc_dev) != 0) |
714 | printk(KERN_INFO "Could not register misc. dev for i8042 rtc\n"); | 702 | printk(KERN_INFO "Could not register misc. dev for i8042 rtc\n"); |
715 | 703 | ||
716 | proc_create("driver/rtc", 0, NULL, &hp_sdc_rtc_proc_fops); | 704 | proc_create_single("driver/rtc", 0, NULL, hp_sdc_rtc_proc_show); |
717 | 705 | ||
718 | printk(KERN_INFO "HP i8042 SDC + MSM-58321 RTC support loaded " | 706 | printk(KERN_INFO "HP i8042 SDC + MSM-58321 RTC support loaded " |
719 | "(RTC v " RTC_VERSION ")\n"); | 707 | "(RTC v " RTC_VERSION ")\n"); |