blackfin RTC driver: wait for the write complete interrupt complete before sleeping
authorMike Frysinger <[email protected]>
Tue, 5 Aug 2008 20:01:20 +0000 (13:01 -0700)
committerLinus Torvalds <[email protected]>
Tue, 5 Aug 2008 21:33:48 +0000 (14:33 -0700)
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 <[email protected]>
Signed-off-by: Bryan Wu <[email protected]>
Cc: David Brownell <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/rtc/rtc-bfin.c

index d53772f59ce5ba45ed3d982c2c49e83af5a7ade2..e6b0470063e831229a9f71516289c56045057441 100644 (file)
@@ -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;