Re: [PATCH] OLPC rtc-cmos support

David Brownell
2007-07-08T05:13:40Z

On Saturday 07 July 2007, Marcelo Tosatti wrote:
>
> Hi,
>
> The following patch implements the hooks necessary for OLPC to use the
> rtc-cmos driver. This is necessary since we do not want CONFIG_PNP.
>
> This makes it possible to control rtc wakeup via
> /sys/devices/platform/rtc_cmos/power/wakeup.
>
> Comments?

Looks almost right ... though I'd have expected the RTC to
support alarms more than just 24 hours into the future!

It's more complicated than necessary. It'd be much simpler
to just declare a static platform_device with pre-initted
platform_data. Then call device_init_wakeup() on that before
calling the usual platform_device_register() routine.

That way you wouldn't need to have two different init sections
just to set up one device, where one of them is spending most
of its time working around the possibility that the other one
failed. And you'd also pretty much eliminate the possibility
that the (now) single init section fails. :)

- Dave