aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/class.c')
-rw-r--r--drivers/rtc/class.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 04aaa6347234..786406c2cf78 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -16,6 +16,9 @@
16#include <linux/kdev_t.h> 16#include <linux/kdev_t.h>
17#include <linux/idr.h> 17#include <linux/idr.h>
18 18
19#include "rtc-core.h"
20
21
19static DEFINE_IDR(rtc_idr); 22static DEFINE_IDR(rtc_idr);
20static DEFINE_MUTEX(idr_lock); 23static DEFINE_MUTEX(idr_lock);
21struct class *rtc_class; 24struct class *rtc_class;
@@ -85,6 +88,8 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
85 if (err) 88 if (err)
86 goto exit_kfree; 89 goto exit_kfree;
87 90
91 rtc_dev_add_device(rtc);
92
88 dev_info(dev, "rtc core: registered %s as %s\n", 93 dev_info(dev, "rtc core: registered %s as %s\n",
89 rtc->name, rtc->class_dev.class_id); 94 rtc->name, rtc->class_dev.class_id);
90 95
@@ -118,6 +123,7 @@ void rtc_device_unregister(struct rtc_device *rtc)
118 /* remove innards of this RTC, then disable it, before 123 /* remove innards of this RTC, then disable it, before
119 * letting any rtc_class_open() users access it again 124 * letting any rtc_class_open() users access it again
120 */ 125 */
126 rtc_dev_del_device(rtc);
121 class_device_unregister(&rtc->class_dev); 127 class_device_unregister(&rtc->class_dev);
122 rtc->ops = NULL; 128 rtc->ops = NULL;
123 mutex_unlock(&rtc->ops_lock); 129 mutex_unlock(&rtc->ops_lock);
@@ -140,11 +146,13 @@ static int __init rtc_init(void)
140 printk(KERN_ERR "%s: couldn't create class\n", __FILE__); 146 printk(KERN_ERR "%s: couldn't create class\n", __FILE__);
141 return PTR_ERR(rtc_class); 147 return PTR_ERR(rtc_class);
142 } 148 }
149 rtc_dev_init();
143 return 0; 150 return 0;
144} 151}
145 152
146static void __exit rtc_exit(void) 153static void __exit rtc_exit(void)
147{ 154{
155 rtc_dev_exit();
148 class_destroy(rtc_class); 156 class_destroy(rtc_class);
149} 157}
150 158