diff options
author | Guenter Roeck <linux@roeck-us.net> | 2014-12-12 19:54:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 15:42:45 -0500 |
commit | 88221c32f98551727cd4b8137fcc857a5294b97f (patch) | |
tree | 717c885abf6bc3e89466b681430856c2e80ba01a /drivers | |
parent | 6ce4436c9cbe903af935291aa219fd6f4c85722d (diff) |
rtc: snvs: fix build with CONFIG_PM_SLEEP disabled
Commit 7654e9d4fd8f ("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: 7654e9d4fd8f ("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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/rtc/rtc-snvs.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c index 2cd8ffe5c698..942b267c6271 100644 --- a/drivers/rtc/rtc-snvs.c +++ b/drivers/rtc/rtc-snvs.c | |||
@@ -344,13 +344,20 @@ static int snvs_rtc_resume(struct device *dev) | |||
344 | 344 | ||
345 | return 0; | 345 | return 0; |
346 | } | 346 | } |
347 | #endif | ||
348 | 347 | ||
349 | static const struct dev_pm_ops snvs_rtc_pm_ops = { | 348 | static const struct dev_pm_ops snvs_rtc_pm_ops = { |
350 | .suspend_noirq = snvs_rtc_suspend, | 349 | .suspend_noirq = snvs_rtc_suspend, |
351 | .resume_noirq = snvs_rtc_resume, | 350 | .resume_noirq = snvs_rtc_resume, |
352 | }; | 351 | }; |
353 | 352 | ||
353 | #define SNVS_RTC_PM_OPS (&snvs_rtc_pm_ops) | ||
354 | |||
355 | #else | ||
356 | |||
357 | #define SNVS_RTC_PM_OPS NULL | ||
358 | |||
359 | #endif | ||
360 | |||
354 | static const struct of_device_id snvs_dt_ids[] = { | 361 | static const struct of_device_id snvs_dt_ids[] = { |
355 | { .compatible = "fsl,sec-v4.0-mon-rtc-lp", }, | 362 | { .compatible = "fsl,sec-v4.0-mon-rtc-lp", }, |
356 | { /* sentinel */ } | 363 | { /* sentinel */ } |
@@ -361,7 +368,7 @@ static struct platform_driver snvs_rtc_driver = { | |||
361 | .driver = { | 368 | .driver = { |
362 | .name = "snvs_rtc", | 369 | .name = "snvs_rtc", |
363 | .owner = THIS_MODULE, | 370 | .owner = THIS_MODULE, |
364 | .pm = &snvs_rtc_pm_ops, | 371 | .pm = SNVS_RTC_PM_OPS, |
365 | .of_match_table = snvs_dt_ids, | 372 | .of_match_table = snvs_dt_ids, |
366 | }, | 373 | }, |
367 | .probe = snvs_rtc_probe, | 374 | .probe = snvs_rtc_probe, |