Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mika Westerberg and committed by
Linus Torvalds
b5ada460 a8a15eb1

+3 -5
+3 -5
drivers/rtc/rtc-cmos.c
··· 837 837 cmos->dev = NULL; 838 838 } 839 839 840 - #ifdef CONFIG_PM 840 + #ifdef CONFIG_PM_SLEEP 841 841 842 842 static int cmos_suspend(struct device *dev) 843 843 { ··· 935 935 return 0; 936 936 } 937 937 938 - static SIMPLE_DEV_PM_OPS(cmos_pm_ops, cmos_suspend, cmos_resume); 939 - 940 938 #else 941 939 942 940 static inline int cmos_poweroff(struct device *dev) ··· 943 945 } 944 946 945 947 #endif 948 + 949 + static SIMPLE_DEV_PM_OPS(cmos_pm_ops, cmos_suspend, cmos_resume); 946 950 947 951 /*----------------------------------------------------------------*/ 948 952 ··· 1088 1088 1089 1089 /* flag ensures resume() gets called, and stops syslog spam */ 1090 1090 .flags = PNP_DRIVER_RES_DO_NOT_CHANGE, 1091 - #ifdef CONFIG_PM_SLEEP 1092 1091 .driver = { 1093 1092 .pm = &cmos_pm_ops, 1094 1093 }, 1095 - #endif 1096 1094 }; 1097 1095 1098 1096 #endif /* CONFIG_PNP */