aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2013-04-29 19:19:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 21:28:28 -0400
commit38a6276e2b56921a407e718079aee79919873d72 (patch)
tree105c46143f650432da4851e8aefeeb3ad54cd3bc
parentcb72f60c17aea5f0bdd546420ebb16075d965f92 (diff)
drivers/rtc/rtc-tegra.c: protect suspend/resume callbacks with CONFIG_PM_SLEEP
CONFIG_PM doesn't actually enable any of the PM callbacks, it only allows to enable CONFIG_PM_SLEEP and CONFIG_PM_RUNTIME. This means if CONFIG_PM is used to protect system sleep callbacks then it may end up unreferenced if only runtime PM is enabled. Hence protecting sleep callbacks with CONFIG_PM_SLEEP. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de> Reviewed-by: Stephen Warren <swarren@nvidia.com> Cc: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/rtc/rtc-tegra.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
index 9447d65fe2b1..916802a58366 100644
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -390,7 +390,7 @@ static int __exit tegra_rtc_remove(struct platform_device *pdev)
390 return 0; 390 return 0;
391} 391}
392 392
393#ifdef CONFIG_PM 393#ifdef CONFIG_PM_SLEEP
394static int tegra_rtc_suspend(struct platform_device *pdev, pm_message_t state) 394static int tegra_rtc_suspend(struct platform_device *pdev, pm_message_t state)
395{ 395{
396 struct device *dev = &pdev->dev; 396 struct device *dev = &pdev->dev;
@@ -446,7 +446,7 @@ static struct platform_driver tegra_rtc_driver = {
446 .owner = THIS_MODULE, 446 .owner = THIS_MODULE,
447 .of_match_table = tegra_rtc_dt_match, 447 .of_match_table = tegra_rtc_dt_match,
448 }, 448 },
449#ifdef CONFIG_PM 449#ifdef CONFIG_PM_SLEEP
450 .suspend = tegra_rtc_suspend, 450 .suspend = tegra_rtc_suspend,
451 .resume = tegra_rtc_resume, 451 .resume = tegra_rtc_resume,
452#endif 452#endif