[PATCH] rtc-cmos: use cmos_rtc_board_info to determine wake_on callback

Marcelo Tosatti
2007-07-08T03:49:53Z

>From my understand ACPI fills a cmos_rtc_board_info with pointers for
wake_on/wake_off callbacks and registers that at dev->platform_data.

So use that to retrieve the callback pointers.

Am I missing something?

diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index e24ea82..5bfab23 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -549,6 +549,7 @@ #ifdef CONFIG_PM
static int cmos_suspend(struct device *dev, pm_message_t mesg)
{
struct cmos_rtc *cmos = dev_get_drvdata(dev);
+ struct cmos_rtc_board_info *board_info = dev->platform_data;
int do_wake = device_may_wakeup(dev);
unsigned char tmp;

@@ -572,8 +573,8 @@ static int cmos_suspend(struct device *d

if (tmp & RTC_AIE) {
cmos->enabled_wake = 1;
- if (cmos->wake_on)
- cmos->wake_on(dev);
+ if (board_info->wake_on)
+ board_info->wake_on(dev);
else
enable_irq_wake(cmos->irq);
}