Re: [PATCH v3] Create add_rtc() function to enable the RTC CMOS driver
From: David Gibson <hidden>
Date: 2007-06-25 03:33:48
On Fri, Jun 22, 2007 at 09:56:24AM +0200, Segher Boessenkool wrote:
quoted
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.quoted
quoted
+ * 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