Skip to content

Commit

Permalink
rtc: snvs: fix build with CONFIG_PM_SLEEP disabled
Browse files Browse the repository at this point in the history
Commit 7654e9d ("drivers/rtc/rtc-snvs: fix suspend/resume")
replaces SIMPLE_DEV_PM_OPS with direct declaration of snvs_rtc_pm_ops,
but does so outside #ifdef CONFIG_PM_SLEEP.  This causes the driver
build to fail if CONFIG_PM_SLEEP is not configured.

Fixes: 7654e9d ("drivers/rtc/rtc-snvs: fix suspend/resume")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: Sanchayan Maity <maitysanchayan@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Guenter Roeck authored and Linus Torvalds committed Dec 13, 2014
1 parent 6ce4436 commit 88221c3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/rtc/rtc-snvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,20 @@ static int snvs_rtc_resume(struct device *dev)

return 0;
}
#endif

static const struct dev_pm_ops snvs_rtc_pm_ops = {
.suspend_noirq = snvs_rtc_suspend,
.resume_noirq = snvs_rtc_resume,
};

#define SNVS_RTC_PM_OPS (&snvs_rtc_pm_ops)

#else

#define SNVS_RTC_PM_OPS NULL

#endif

static const struct of_device_id snvs_dt_ids[] = {
{ .compatible = "fsl,sec-v4.0-mon-rtc-lp", },
{ /* sentinel */ }
Expand All @@ -361,7 +368,7 @@ static struct platform_driver snvs_rtc_driver = {
.driver = {
.name = "snvs_rtc",
.owner = THIS_MODULE,
.pm = &snvs_rtc_pm_ops,
.pm = SNVS_RTC_PM_OPS,
.of_match_table = snvs_dt_ids,
},
.probe = snvs_rtc_probe,
Expand Down

0 comments on commit 88221c3

Please sign in to comment.