提交 38a6276e 编写于 作者: L Laxman Dewangan 提交者: Linus Torvalds

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: NLaxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: NThierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: NStephen Warren <swarren@nvidia.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 cb72f60c
...@@ -390,7 +390,7 @@ static int __exit tegra_rtc_remove(struct platform_device *pdev) ...@@ -390,7 +390,7 @@ static int __exit tegra_rtc_remove(struct platform_device *pdev)
return 0; return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int tegra_rtc_suspend(struct platform_device *pdev, pm_message_t state) static int tegra_rtc_suspend(struct platform_device *pdev, pm_message_t state)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -446,7 +446,7 @@ static struct platform_driver tegra_rtc_driver = { ...@@ -446,7 +446,7 @@ static struct platform_driver tegra_rtc_driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = tegra_rtc_dt_match, .of_match_table = tegra_rtc_dt_match,
}, },
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
.suspend = tegra_rtc_suspend, .suspend = tegra_rtc_suspend,
.resume = tegra_rtc_resume, .resume = tegra_rtc_resume,
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册