summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/class.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-05-08 00:33:27 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 11:15:18 -0700
commit5726fb2012f0d96153113ddb7f988a0daea587ce (patch)
tree27f31cfcc330cc3bc46dcc5297f85080f6f04ab7 /drivers/rtc/class.c
parent1c710c896eb461895d3c399e15bb5f20b39c9073 (diff)
downloadop-kernel-dev-5726fb2012f0d96153113ddb7f988a0daea587ce.zip
op-kernel-dev-5726fb2012f0d96153113ddb7f988a0daea587ce.tar.gz
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 04aaa63..786406c 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -16,6 +16,9 @@
#include <linux/kdev_t.h>
#include <linux/idr.h>
+#include "rtc-core.h"
+
+
static DEFINE_IDR(rtc_idr);
static DEFINE_MUTEX(idr_lock);
struct class *rtc_class;
@@ -85,6 +88,8 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
if (err)
goto exit_kfree;
+ rtc_dev_add_device(rtc);
+
dev_info(dev, "rtc core: registered %s as %s\n",
rtc->name, rtc->class_dev.class_id);
@@ -118,6 +123,7 @@ void rtc_device_unregister(struct rtc_device *rtc)
/* remove innards of this RTC, then disable it, before
* letting any rtc_class_open() users access it again
*/
+ rtc_dev_del_device(rtc);
class_device_unregister(&rtc->class_dev);
rtc->ops = NULL;
mutex_unlock(&rtc->ops_lock);
@@ -140,11 +146,13 @@ static int __init rtc_init(void)
printk(KERN_ERR "%s: couldn't create class\n", __FILE__);
return PTR_ERR(rtc_class);
}
+ rtc_dev_init();
return 0;
}
static void __exit rtc_exit(void)
{
+ rtc_dev_exit();
class_destroy(rtc_class);
}
OpenPOWER on IntegriCloud