Skip to content

Commit b5ada46

Browse files
westeritorvalds
authored andcommitted
drivers/rtc/rtc-cmos.c: fix compilation warning when !CONFIG_PM_SLEEP
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>
1 parent a8a15eb commit b5ada46

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎drivers/rtc/rtc-cmos.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ static void __exit cmos_do_remove(struct device *dev)
837837
cmos->dev = NULL;
838838
}
839839

840-
#ifdef CONFIG_PM
840+
#ifdef CONFIG_PM_SLEEP
841841

842842
static int cmos_suspend(struct device *dev)
843843
{
@@ -935,8 +935,6 @@ static int cmos_resume(struct device *dev)
935935
return 0;
936936
}
937937

938-
static SIMPLE_DEV_PM_OPS(cmos_pm_ops, cmos_suspend, cmos_resume);
939-
940938
#else
941939

942940
static inline int cmos_poweroff(struct device *dev)
@@ -946,6 +944,8 @@ static inline int cmos_poweroff(struct device *dev)
946944

947945
#endif
948946

947+
static SIMPLE_DEV_PM_OPS(cmos_pm_ops, cmos_suspend, cmos_resume);
948+
949949
/*----------------------------------------------------------------*/
950950

951951
/* On non-x86 systems, a "CMOS" RTC lives most naturally on platform_bus.
@@ -1088,11 +1088,9 @@ static struct pnp_driver cmos_pnp_driver = {
10881088

10891089
/* flag ensures resume() gets called, and stops syslog spam */
10901090
.flags = PNP_DRIVER_RES_DO_NOT_CHANGE,
1091-
#ifdef CONFIG_PM_SLEEP
10921091
.driver = {
10931092
.pm = &cmos_pm_ops,
10941093
},
1095-
#endif
10961094
};
10971095

10981096
#endif /* CONFIG_PNP */

0 commit comments

Comments
 (0)