Subject: Re: [PATCH] powerpc: consolidate mpc83xx platform files

From: Benjamin Herrenschmidt <[email-masked]>
Date: Tue, 19 Dec 2006 08:23:53 +1100

> +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.