aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-proc.c')
-rw-r--r--drivers/rtc/rtc-proc.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c
index c086fc30a84..0a59fda5c09 100644
--- a/drivers/rtc/rtc-proc.c
+++ b/drivers/rtc/rtc-proc.c
@@ -69,6 +69,14 @@ static int rtc_proc_show(struct seq_file *seq, void *offset)
69 alrm.enabled ? "yes" : "no"); 69 alrm.enabled ? "yes" : "no");
70 seq_printf(seq, "alrm_pending\t: %s\n", 70 seq_printf(seq, "alrm_pending\t: %s\n",
71 alrm.pending ? "yes" : "no"); 71 alrm.pending ? "yes" : "no");
72 seq_printf(seq, "update IRQ enabled\t: %s\n",
73 (rtc->uie_rtctimer.enabled) ? "yes" : "no");
74 seq_printf(seq, "periodic IRQ enabled\t: %s\n",
75 (rtc->pie_enabled) ? "yes" : "no");
76 seq_printf(seq, "periodic IRQ frequency\t: %d\n",
77 rtc->irq_freq);
78 seq_printf(seq, "max user IRQ frequency\t: %d\n",
79 rtc->max_user_freq);
72 } 80 }
73 81
74 seq_printf(seq, "24hr\t\t: yes\n"); 82 seq_printf(seq, "24hr\t\t: yes\n");
@@ -81,12 +89,16 @@ static int rtc_proc_show(struct seq_file *seq, void *offset)
81 89
82static int rtc_proc_open(struct inode *inode, struct file *file) 90static int rtc_proc_open(struct inode *inode, struct file *file)
83{ 91{
92 int ret;
84 struct rtc_device *rtc = PDE(inode)->data; 93 struct rtc_device *rtc = PDE(inode)->data;
85 94
86 if (!try_module_get(THIS_MODULE)) 95 if (!try_module_get(THIS_MODULE))
87 return -ENODEV; 96 return -ENODEV;
88 97
89 return single_open(file, rtc_proc_show, rtc); 98 ret = single_open(file, rtc_proc_show, rtc);
99 if (ret)
100 module_put(THIS_MODULE);
101 return ret;
90} 102}
91 103
92static int rtc_proc_release(struct inode *inode, struct file *file) 104static int rtc_proc_release(struct inode *inode, struct file *file)