drivers/rtc/rtc-tegra.c: protect suspend/resume callbacks with CONFIG_PM_SLEEP
authorLaxman Dewangan <ldewangan@nvidia.com>
Mon, 29 Apr 2013 23:19:21 +0000 (16:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Apr 2013 01:28:28 +0000 (18:28 -0700)
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>
drivers/rtc/rtc-tegra.c

index 9447d65fe2b1393b7a12aa344778127dd6a6306f..916802a58366452db6cff890532bfd00cf39aa5a 100644 (file)
@@ -390,7 +390,7 @@ static int __exit tegra_rtc_remove(struct platform_device *pdev)
        return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int tegra_rtc_suspend(struct platform_device *pdev, pm_message_t state)
 {
        struct device *dev = &pdev->dev;
@@ -446,7 +446,7 @@ static struct platform_driver tegra_rtc_driver = {
                .owner  = THIS_MODULE,
                .of_match_table = tegra_rtc_dt_match,
        },
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
        .suspend        = tegra_rtc_suspend,
        .resume         = tegra_rtc_resume,
 #endif