diff mbox

[V2] i2c: tegra: protect suspend/resume callbacks with CONFIG_PM_SLEEP

Message ID 1345292398-10609-1-git-send-email-ldewangan@nvidia.com
State Not Applicable, archived
Headers show

Commit Message

Laxman Dewangan Aug. 18, 2012, 12:19 p.m. UTC
The 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>
---
This patch will remove the compilation warning if CONFIG_PM_SLEEP
is not enabled.

Change from V1 ->V2:
provide more details in description as per Mark's response.

 drivers/i2c/busses/i2c-tegra.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Wolfram Sang Aug. 18, 2012, 6:46 p.m. UTC | #1
On Sat, Aug 18, 2012 at 05:49:58PM +0530, Laxman Dewangan wrote:
> The 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>

Applied to -current, thanks!
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 66eb53f..9a08c57 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -712,7 +712,7 @@  static int __devexit tegra_i2c_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int tegra_i2c_suspend(struct device *dev)
 {
 	struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);