From: Mike Frysinger Date: Tue, 5 Aug 2008 20:01:20 +0000 (-0700) Subject: blackfin RTC driver: wait for the write complete interrupt complete before sleeping X-Git-Tag: v2.6.27-rc2~22 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=140fab14aef093cedf87f69234474c04fdcec99c;p=linux-2.6 blackfin RTC driver: wait for the write complete interrupt complete before sleeping Since we use the write complete interrupt, wait for it to complete before sleeping so we don't wake right back up due to it Signed-off-by: Mike Frysinger Signed-off-by: Bryan Wu Cc: David Brownell Cc: Alessandro Zummo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index d53772f59c..e6b0470063 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c @@ -435,9 +435,10 @@ static int __devexit bfin_rtc_remove(struct platform_device *pdev) #ifdef CONFIG_PM static int bfin_rtc_suspend(struct platform_device *pdev, pm_message_t state) { - if (device_may_wakeup(&pdev->dev)) + if (device_may_wakeup(&pdev->dev)) { enable_irq_wake(IRQ_RTC); - else + bfin_rtc_sync_pending(&pdev->dev); + } else bfin_rtc_int_clear(-1); return 0;