[PATCH v3] Create add_rtc() function to enable the RTC CMOS driver

David Gibson david at gibson.dropbear.id.au
Mon Jun 25 13:33:48 EST 2007


On Fri, Jun 22, 2007 at 09:56:24AM +0200, Segher Boessenkool wrote:
> > Hrm.  It seems rather specific.  Can we do this more generally, by
> > creating an of_platform device which binds to rtc nodes, then
> > registers an appropriate platform device for each so that the generic
> > rtc drivers pick them up.  Obviously we'd need some sort of table
> > mapping the device node compatible properties to the appropriate
> > platform device names.
> 
> >> +	 * RTC_PORT(x) is hardcoded in asm/mc146818rtc.h.  Verify that the
> >> +	 * address provided by the device node matches.
> >> +	 */
> >> +	if (res.start != RTC_PORT(0)) {
> >> +		of_node_put(np);
> >> +		return -ENODEV;
> >> +	}
> >
> > This looks totally bogus.  If we have a device tree we should be using
> > the address information from there, not using hardcoded magic.  Sounds
> > like asm/mc146818rtc.h needs some serious fixing.
> 
> Both of your comments would be nice extensions (and the right
> way forwards), but Wade's patch is good as-is already.

True enough.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson



More information about the Linuxppc-dev mailing list