rtc: convert rtc-cmos to dev_pm_ops from legacy pm_ops
authorShuah Khan <shuah.kh@samsung.com>
Wed, 11 Sep 2013 21:23:11 +0000 (14:23 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Sep 2013 22:58:15 +0000 (15:58 -0700)
Convert drivers/rtc/rtc-cmos to use dev_pm_ops instead of legacy pm_ops.
This patch depends on pnp driver bus ops change to invoke pnp_driver
dev_pm_ops.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
Cc: Matthew Garrett <matthew.garrett@nebula.com>
Cc: Leonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
Cc: Ashley Lai <ashley@ashleylai.com>
Cc: Rajiv Andrade <mail@srajiv.net>
Cc: Marcel Selhorst <tpmdd@selhorst.net>
Cc: Sirrix AG <tpmdd@sirrix.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Peter Hüwe <PeterHuewe@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-cmos.c

index be06d7150de5d4b81f6c84e9c5cc874e26360e70..24e733c98f8b69dd13b0b51ef4eab968068a4b85 100644 (file)
@@ -1018,23 +1018,6 @@ static void __exit cmos_pnp_remove(struct pnp_dev *pnp)
        cmos_do_remove(&pnp->dev);
 }
 
-#ifdef CONFIG_PM
-
-static int cmos_pnp_suspend(struct pnp_dev *pnp, pm_message_t mesg)
-{
-       return cmos_suspend(&pnp->dev);
-}
-
-static int cmos_pnp_resume(struct pnp_dev *pnp)
-{
-       return cmos_resume(&pnp->dev);
-}
-
-#else
-#define        cmos_pnp_suspend        NULL
-#define        cmos_pnp_resume         NULL
-#endif
-
 static void cmos_pnp_shutdown(struct pnp_dev *pnp)
 {
        if (system_state == SYSTEM_POWER_OFF && !cmos_poweroff(&pnp->dev))
@@ -1060,8 +1043,11 @@ static struct pnp_driver cmos_pnp_driver = {
 
        /* flag ensures resume() gets called, and stops syslog spam */
        .flags          = PNP_DRIVER_RES_DO_NOT_CHANGE,
-       .suspend        = cmos_pnp_suspend,
-       .resume         = cmos_pnp_resume,
+#ifdef CONFIG_PM_SLEEP
+       .driver         = {
+                       .pm = &cmos_pm_ops,
+       },
+#endif
 };
 
 #endif /* CONFIG_PNP */