[PORT FROM R2] rtc-mrst: Migrate legacy suspend/resume callbacks of rtc driver to...
authorhe bo <bo.he@intel.com>
Mon, 30 May 2011 05:35:42 +0000 (13:35 +0800)
committerbuildbot <buildbot@intel.com>
Tue, 24 Jan 2012 12:18:57 +0000 (04:18 -0800)
BZ: 2607

rtc driver uses legacy suspend/resume callbacks.
Migrate them to dev_pm_ops.do not use legacy for D3 suspend/resume callbacks

Change-Id: I8003640c25b35f3d8a721597762967ac77920283
Orig-Change-Id: If0397defee1966b6a153e4849f212ecd8f5c6d05
Signed-off-by: he bo <bo.he@intel.com>
Signed-off-by: Loic Martin <loicx.martin@intel.com>
Reviewed-on: http://android.intel.com:8080/32683
Reviewed-by: Mansoor, Illyas <illyas.mansoor@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/rtc/rtc-mrst.c

index be276db..523a76f 100644 (file)
@@ -438,7 +438,7 @@ static void __devexit rtc_mrst_do_remove(struct device *dev)
 }
 
 #ifdef CONFIG_PM
-static int mrst_suspend(struct device *dev, pm_message_t mesg)
+static int mrst_suspend(struct device *dev)
 {
        struct mrst_rtc *mrst = dev_get_drvdata(dev);
        unsigned char   tmp;
@@ -477,7 +477,7 @@ static int mrst_suspend(struct device *dev, pm_message_t mesg)
  */
 static inline int mrst_poweroff(struct device *dev)
 {
-       return mrst_suspend(dev, PMSG_HIBERNATE);
+       return mrst_suspend(dev);
 }
 
 static int mrst_resume(struct device *dev)
@@ -548,15 +548,17 @@ static void vrtc_mrst_platform_shutdown(struct platform_device *pdev)
 
 MODULE_ALIAS("platform:vrtc_mrst");
 
+static const struct dev_pm_ops vrtc_mrst_platform_driver_pm_ops = {
+       .suspend        = mrst_suspend,
+       .resume         = mrst_resume,
+};
+
 static struct platform_driver vrtc_mrst_platform_driver = {
        .probe          = vrtc_mrst_platform_probe,
        .remove         = __devexit_p(vrtc_mrst_platform_remove),
        .shutdown       = vrtc_mrst_platform_shutdown,
-       .driver = {
-               .name           = (char *) driver_name,
-               .suspend        = mrst_suspend,
-               .resume         = mrst_resume,
-       }
+       .driver.name            = (char *) driver_name,
+       .driver.pm = &vrtc_mrst_platform_driver_pm_ops,
 };
 
 static int __init vrtc_mrst_init(void)