Re: [linux-pm] sleepy linux self-test
From: Pavel Machek
Date: Sat Feb 02 2008 - 07:47:52 EST
Hi!
> > --- a/drivers/rtc/rtc-cmos.c
> > +++ b/drivers/rtc/rtc-cmos.c
> > @@ -78,7 +78,7 @@ static inline int is_intr(u8 rtc_intr)
> >
> > /*----------------------------------------------------------------*/
> >
> > -static int cmos_read_time(struct device *dev, struct rtc_time *t)
> > +int cmos_read_time(struct device *dev, struct rtc_time *t)
> > {
> >
> > ... etc ...
>
> You should be using the standard RTC library calls, exported
> from drivers/rtc/interface.c ... and making sure this mechanism
> will work with any wakeup-capable RTC. Otherwise you'll end
> being needlessly x86-specific, or reinventing those calls.
>
> Plus, the way you're doing it now is violating the locking
> protocol used by that driver.
Yep, you are right, but that is the easy issue to fix. There's hard
issue: I need
struct rtc_device *rtc
for the rtc that can be used for system resume, and I'd like to get it
without violating too many layers. How to do that?
Ideally, I need
set_alarm(int)
...that will magically pick the right rtc device to talk to, and set
alarm on it. I don't see how to implement it with current code.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/