]> Pileus Git - ~andy/linux/blobdiff - drivers/rtc/rtc-pxa.c
Merge tag 'soc-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[~andy/linux] / drivers / rtc / rtc-pxa.c
index 03c85ee719a7f46e95b45c0e08d375697c5f396e..ed037ae91c5fcddf2fb21b644da0bb91a79c0402 100644 (file)
@@ -416,7 +416,7 @@ static struct of_device_id pxa_rtc_dt_ids[] = {
 MODULE_DEVICE_TABLE(of, pxa_rtc_dt_ids);
 #endif
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int pxa_rtc_suspend(struct device *dev)
 {
        struct pxa_rtc *pxa_rtc = dev_get_drvdata(dev);
@@ -434,36 +434,20 @@ static int pxa_rtc_resume(struct device *dev)
                disable_irq_wake(pxa_rtc->irq_Alrm);
        return 0;
 }
-
-static const struct dev_pm_ops pxa_rtc_pm_ops = {
-       .suspend        = pxa_rtc_suspend,
-       .resume         = pxa_rtc_resume,
-};
 #endif
 
+static SIMPLE_DEV_PM_OPS(pxa_rtc_pm_ops, pxa_rtc_suspend, pxa_rtc_resume);
+
 static struct platform_driver pxa_rtc_driver = {
        .remove         = __exit_p(pxa_rtc_remove),
        .driver         = {
                .name   = "pxa-rtc",
                .of_match_table = of_match_ptr(pxa_rtc_dt_ids),
-#ifdef CONFIG_PM
                .pm     = &pxa_rtc_pm_ops,
-#endif
        },
 };
 
-static int __init pxa_rtc_init(void)
-{
-       return platform_driver_probe(&pxa_rtc_driver, pxa_rtc_probe);
-}
-
-static void __exit pxa_rtc_exit(void)
-{
-       platform_driver_unregister(&pxa_rtc_driver);
-}
-
-module_init(pxa_rtc_init);
-module_exit(pxa_rtc_exit);
+module_platform_driver_probe(pxa_rtc_driver, pxa_rtc_probe);
 
 MODULE_AUTHOR("Robert Jarzmik <robert.jarzmik@free.fr>");
 MODULE_DESCRIPTION("PXA27x/PXA3xx Realtime Clock Driver (RTC)");