rtc: simplified rtc sysfs attribute handling

This simplifies the RTC sysfs support by removing the class_interface that
hooks it into the rtc core.  If it's configured, then sysfs 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".

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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 786406c..5845e6e 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -89,6 +89,7 @@
 		goto exit_kfree;
 
 	rtc_dev_add_device(rtc);
+	rtc_sysfs_add_device(rtc);
 
 	dev_info(dev, "rtc core: registered %s as %s\n",
 			rtc->name, rtc->class_dev.class_id);
@@ -123,6 +124,7 @@
 		/* remove innards of this RTC, then disable it, before
 		 * letting any rtc_class_open() users access it again
 		 */
+		rtc_sysfs_del_device(rtc);
 		rtc_dev_del_device(rtc);
 		class_device_unregister(&rtc->class_dev);
 		rtc->ops = NULL;
@@ -147,6 +149,7 @@
 		return PTR_ERR(rtc_class);
 	}
 	rtc_dev_init();
+	rtc_sysfs_init(rtc_class);
 	return 0;
 }