i2c: tegra: protect suspend/resume callbacks with CONFIG_PM_SLEEP
Laxman Dewangan [Tue, 21 Aug 2012 08:08:47 +0000 (13:08 +0530)]
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>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>

Change-Id: I090e167c1de8f254a278e9e3b511292cfbc5f250
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/124872
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

drivers/i2c/busses/i2c-tegra.c

index 598c3ae..2597db6 100644 (file)
@@ -1056,7 +1056,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_noirq(struct device *dev)
 {
        struct platform_device *pdev = to_platform_device(dev);