aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/class.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-05-08 03:33:27 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:18 -0400
commit5726fb2012f0d96153113ddb7f988a0daea587ce (patch)
tree27f31cfcc330cc3bc46dcc5297f85080f6f04ab7 /drivers/rtc/class.c
parent1c710c896eb461895d3c399e15bb5f20b39c9073 (diff)
rtc: remove /sys/class/rtc-dev/*
This simplifies the /dev support by removing a superfluous class_device (the /sys/class/rtc-dev stuff) and the class_interface that hooks it into the rtc core. Accordingly, if it's configured then /dev support is now part of the RTC core, and is never a separate module. It's another step towards being able to remove "struct class_device". [bunk@stusta.de: drivers/rtc/rtc-dev.c should #include "rtc-core.h"] Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-By: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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