Commit a882b14f authored by Daniel Glöckner's avatar Daniel Glöckner Committed by Linus Torvalds

rtc-cmos: fix wakeup from S5 without CONFIG_PM_SLEEP

Commit b5ada460 ("drivers/rtc/rtc-cmos.c: fix compilation warning
when !CONFIG_PM_SLEEP") broke wakeup from S5 by making cmos_poweroff a
nop unless CONFIG_PM_SLEEP was defined.

Fix this by restricting the #ifdef to cmos_resume and restoring the old
dependency on CONFIG_PM for cmos_suspend and cmos_poweroff.
Signed-off-by: default avatarDaniel Glöckner <daniel-gl@gmx.net>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 706b632d
...@@ -856,7 +856,7 @@ static void __exit cmos_do_remove(struct device *dev) ...@@ -856,7 +856,7 @@ static void __exit cmos_do_remove(struct device *dev)
cmos->dev = NULL; cmos->dev = NULL;
} }
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM
static int cmos_suspend(struct device *dev) static int cmos_suspend(struct device *dev)
{ {
...@@ -907,6 +907,8 @@ static inline int cmos_poweroff(struct device *dev) ...@@ -907,6 +907,8 @@ static inline int cmos_poweroff(struct device *dev)
return cmos_suspend(dev); return cmos_suspend(dev);
} }
#ifdef CONFIG_PM_SLEEP
static int cmos_resume(struct device *dev) static int cmos_resume(struct device *dev)
{ {
struct cmos_rtc *cmos = dev_get_drvdata(dev); struct cmos_rtc *cmos = dev_get_drvdata(dev);
...@@ -954,6 +956,7 @@ static int cmos_resume(struct device *dev) ...@@ -954,6 +956,7 @@ static int cmos_resume(struct device *dev)
return 0; return 0;
} }
#endif
#else #else
static inline int cmos_poweroff(struct device *dev) static inline int cmos_poweroff(struct device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment