drivers/rtc/rtc-cmos.c: fix compilation warning when !CONFIG_PM_SLEEP
authorMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 3 Apr 2014 21:50:05 +0000 (14:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Apr 2014 23:21:21 +0000 (16:21 -0700)
CONFIG_PM will be set also if only CONFIG_PM_RUNTIME is set which causes
the compiler to emit following warning:

  drivers/rtc/rtc-cmos.c:845:12: warning: =E2=80=98cmos_resume=E2=80=99 defined but not used [-Wunused-function]

Fix this by using CONFIG_PM_SLEEP instead of CONFIG_PM and removing it
from the driver pm ops as this has been taken care by
SIMPLE_DEV_PM_OPS() already.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-cmos.c

index cae212f30d6512f481b9dba7070f25aa00ce2c3d..0963c9309c74556bc40062693797514efde0dd91 100644 (file)
@@ -837,7 +837,7 @@ static void __exit cmos_do_remove(struct device *dev)
        cmos->dev = NULL;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 
 static int cmos_suspend(struct device *dev)
 {
@@ -935,8 +935,6 @@ static int cmos_resume(struct device *dev)
        return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(cmos_pm_ops, cmos_suspend, cmos_resume);
-
 #else
 
 static inline int cmos_poweroff(struct device *dev)
@@ -946,6 +944,8 @@ static inline int cmos_poweroff(struct device *dev)
 
 #endif
 
+static SIMPLE_DEV_PM_OPS(cmos_pm_ops, cmos_suspend, cmos_resume);
+
 /*----------------------------------------------------------------*/
 
 /* On non-x86 systems, a "CMOS" RTC lives most naturally on platform_bus.
@@ -1088,11 +1088,9 @@ static struct pnp_driver cmos_pnp_driver = {
 
        /* flag ensures resume() gets called, and stops syslog spam */
        .flags          = PNP_DRIVER_RES_DO_NOT_CHANGE,
-#ifdef CONFIG_PM_SLEEP
        .driver         = {
                        .pm = &cmos_pm_ops,
        },
-#endif
 };
 
 #endif /* CONFIG_PNP */