[ARM] pxa: update rtc-pxa.c to use 'struct dev_pm_ops'
authorRobert Jarzmik <robert.jarzmik@free.fr>
Tue, 21 Jul 2009 20:47:32 +0000 (22:47 +0200)
committerEric Miao <eric.y.miao@gmail.com>
Thu, 10 Sep 2009 11:15:35 +0000 (19:15 +0800)
Remove the following warning:
Platform driver 'pxa-rtc' needs updating - please use dev_pm_ops

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
drivers/rtc/rtc-pxa.c

index bb8cc05605acdeec83c1d1a66f6207d40e91d8a8..747ca194fad4ac2ec319eac087bda3396fa3f309 100644 (file)
@@ -438,34 +438,37 @@ static int __exit pxa_rtc_remove(struct platform_device *pdev)
 }
 
 #ifdef CONFIG_PM
-static int pxa_rtc_suspend(struct platform_device *pdev, pm_message_t state)
+static int pxa_rtc_suspend(struct device *dev)
 {
-       struct pxa_rtc *pxa_rtc = platform_get_drvdata(pdev);
+       struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev);
 
-       if (device_may_wakeup(&pdev->dev))
+       if (device_may_wakeup(dev))
                enable_irq_wake(pxa_rtc->irq_Alrm);
        return 0;
 }
 
-static int pxa_rtc_resume(struct platform_device *pdev)
+static int pxa_rtc_resume(struct device *dev)
 {
-       struct pxa_rtc *pxa_rtc = platform_get_drvdata(pdev);
+       struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev);
 
-       if (device_may_wakeup(&pdev->dev))
+       if (device_may_wakeup(dev))
                disable_irq_wake(pxa_rtc->irq_Alrm);
        return 0;
 }
-#else
-#define pxa_rtc_suspend        NULL
-#define pxa_rtc_resume NULL
+
+static struct dev_pm_ops pxa_rtc_pm_ops = {
+       .suspend        = pxa_rtc_suspend,
+       .resume         = pxa_rtc_resume,
+};
 #endif
 
 static struct platform_driver pxa_rtc_driver = {
        .remove         = __exit_p(pxa_rtc_remove),
-       .suspend        = pxa_rtc_suspend,
-       .resume         = pxa_rtc_resume,
        .driver         = {
-               .name           = "pxa-rtc",
+               .name   = "pxa-rtc",
+#ifdef CONFIG_PM
+               .pm     = &pxa_rtc_pm_ops,
+#endif
        },
 };