aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-proc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-05 14:09:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-05 14:09:16 -0400
commit11126c611e10abb18b6f1ed0300c0548c3906b54 (patch)
tree246227ad730c1e68f5a9c03db57cd4592abe7687 /drivers/rtc/rtc-proc.c
parent67966e088b0c7dc926f4ce19565ebf208e18d058 (diff)
parent33e2a4227ddff7c18921ac175fae3ab0e3ff8a76 (diff)
Merge branch 'akpm' (Andrew's patch-bomb)
Merge misc patches from Andrew Morton: "The MM tree is rather stuck while I wait to find out what the heck is happening with sched/numa. Probably I'll need to route around all the code which was added to -next, sigh. So this is "everything else", or at least most of it - other small bits are still awaiting resolutions of various kinds." * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (180 commits) lib/decompress.c add __init to decompress_method and data kernel/resource.c: fix stack overflow in __reserve_region_with_split() omfs: convert to use beXX_add_cpu() taskstats: cgroupstats_user_cmd() may leak on error aoe: update aoe-internal version number to 50 aoe: update documentation to better reflect aoe-plus-udev usage aoe: remove unused code aoe: make dynamic block minor numbers the default aoe: update and specify AoE address guards and error messages aoe: retain static block device numbers for backwards compatibility aoe: support more AoE addresses with dynamic block device minor numbers aoe: update documentation with new URL and VM settings reference aoe: update copyright year in touched files aoe: update internal version number to 49 aoe: remove unused code and add cosmetic improvements aoe: increase net_device reference count while using it aoe: associate frames with the AoE storage target aoe: disallow unsupported AoE minor addresses aoe: do revalidation steps in order aoe: failover remote interface based on aoe_deadsecs parameter ...
Diffstat (limited to 'drivers/rtc/rtc-proc.c')
-rw-r--r--drivers/rtc/rtc-proc.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-proc.c b/drivers/rtc/rtc-proc.c
index 0a59fda5c09d..e96236ac2e78 100644
--- a/drivers/rtc/rtc-proc.c
+++ b/drivers/rtc/rtc-proc.c
@@ -18,6 +18,26 @@
18 18
19#include "rtc-core.h" 19#include "rtc-core.h"
20 20
21#define NAME_SIZE 10
22
23#if defined(CONFIG_RTC_HCTOSYS_DEVICE)
24static bool is_rtc_hctosys(struct rtc_device *rtc)
25{
26 int size;
27 char name[NAME_SIZE];
28
29 size = scnprintf(name, NAME_SIZE, "rtc%d", rtc->id);
30 if (size > NAME_SIZE)
31 return false;
32
33 return !strncmp(name, CONFIG_RTC_HCTOSYS_DEVICE, NAME_SIZE);
34}
35#else
36static bool is_rtc_hctosys(struct rtc_device *rtc)
37{
38 return (rtc->id == 0);
39}
40#endif
21 41
22static int rtc_proc_show(struct seq_file *seq, void *offset) 42static int rtc_proc_show(struct seq_file *seq, void *offset)
23{ 43{
@@ -117,12 +137,12 @@ static const struct file_operations rtc_proc_fops = {
117 137
118void rtc_proc_add_device(struct rtc_device *rtc) 138void rtc_proc_add_device(struct rtc_device *rtc)
119{ 139{
120 if (rtc->id == 0) 140 if (is_rtc_hctosys(rtc))
121 proc_create_data("driver/rtc", 0, NULL, &rtc_proc_fops, rtc); 141 proc_create_data("driver/rtc", 0, NULL, &rtc_proc_fops, rtc);
122} 142}
123 143
124void rtc_proc_del_device(struct rtc_device *rtc) 144void rtc_proc_del_device(struct rtc_device *rtc)
125{ 145{
126 if (rtc->id == 0) 146 if (is_rtc_hctosys(rtc))
127 remove_proc_entry("driver/rtc", NULL); 147 remove_proc_entry("driver/rtc", NULL);
128} 148}