Thread (8 messages) flat view 8 messages, 6 authors, 2006-12-18

Re: [PATCH] powerpc: consolidate mpc83xx platform files

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2006-12-18 21:24:01

+static int __init genrtc_rtc_hookup(void)
+{
+	/* Don't init if the platform has already set up rtc functions. */
+	if (ppc_md.get_rtc_time || ppc_md.set_rtc_time)
+		return -1;
+
+	rtc_dev = rtc_class_open("rtc0");
+
+	if (!rtc_dev) {
+		printk("genrtc_rtc_hookup: Failed to open rtc0\n");
+		return -1;
+	}
+
+	ppc_md.get_rtc_time = genrtc_get_rtc_time;
+	ppc_md.set_rtc_time = genrtc_set_rtc_time;
+
+	return 0;
+}
+late_initcall(genrtc_rtc_hookup);
+
This should be called by the platform code. Not all platform want to
hook on genrtc. Even worth, some of the RTC drivers provided by genrtc
aren't suitable at all because the NTP code will call them at interrupt
time (like the i2c ones).

Ben.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help