Re: [PATCH] OLPC rtc-cmos support

David Brownell
2007-07-08T19:10:50Z

On Sunday 08 July 2007, Marcelo Tosatti wrote:

> Like this?

Not quite ...

> +struct resource rtc_platform_irq = {
> + .flags = IORESOURCE_IRQ,
> + .start = 8,
> + .end = 8,
> +};

Unused, right?

> +static int olpc_rtc_init(void)

... should be marked __init ...

> +{
> + rtc_info.rtc_day_alarm = 0;
> + rtc_info.rtc_mon_alarm = 0;
> + rtc_info.rtc_century = 0;
> + rtc_info.wake_on = rtc_wake_on;
> + rtc_info.wake_off = rtc_wake_off;

... that can all just be static init ...

> +
> + (void)platform_device_register(&olpc_rtc_device);
> +
> + device_init_wakeup(&olpc_rtc_device.dev, 1);

... do the init_wakeup before registering the device, so
there can never be confusion about whether a probe() will
see that part of device config ...

> +
> + return 0;
> +}
> +fs_initcall(olpc_rtc_init);

... and try to register platform devices in arch_initcall().
Just to avoid potential confusion; that's where it's normally
done, and I don't think you had a need to do it elsewhere.

- Dave

> +#endif /* CONFIG_RTC_DRV_CMOS */
> +
> static void olpc_pm_exit(void)
> {
> /* Clear any pending events, and disable them */
>