Patchwork [3/5] i2c: puv3: add CONFIG_PM_SLEEP to suspend function

login
register
mail settings
Submitter Jingoo Han
Date March 26, 2013, 6:56 a.m.
Message ID <001701ce29ef$1af32cf0$50d986d0$%han@samsung.com>
Download mbox | patch
Permalink /patch/231101/
State Changes Requested
Headers show

Comments

Jingoo Han - March 26, 2013, 6:56 a.m.
Add CONFIG_PM_SLEEP to suspend function to fix the following build
warning when CONFIG_PM_SLEEP is not selected. This is because
sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when
the CONFIG_PM_SLEEP is enabled.

drivers/i2c/busses/i2c-puv3.c:255:12: warning: 'puv3_i2c_suspend' defined but not used [-Wunused-function]

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/i2c/busses/i2c-puv3.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

Patch

diff --git a/drivers/i2c/busses/i2c-puv3.c b/drivers/i2c/busses/i2c-puv3.c
index 8acef65..1a73ce0 100644
--- a/drivers/i2c/busses/i2c-puv3.c
+++ b/drivers/i2c/busses/i2c-puv3.c
@@ -251,7 +251,7 @@  static int puv3_i2c_remove(struct platform_device *pdev)
 	return rc;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int puv3_i2c_suspend(struct device *dev)
 {
 	int poll_count;
@@ -264,13 +264,9 @@  static int puv3_i2c_suspend(struct device *dev)
 
 	return 0;
 }
+#endif
 
 static SIMPLE_DEV_PM_OPS(puv3_i2c_pm, puv3_i2c_suspend, NULL);
-#define PUV3_I2C_PM	(&puv3_i2c_pm)
-
-#else
-#define PUV3_I2C_PM	NULL
-#endif
 
 static struct platform_driver puv3_i2c_driver = {
 	.probe		= puv3_i2c_probe,
@@ -278,7 +274,7 @@  static struct platform_driver puv3_i2c_driver = {
 	.driver		= {
 		.name	= "PKUnity-v3-I2C",
 		.owner	= THIS_MODULE,
-		.pm	= PUV3_I2C_PM,
+		.pm	= &puv3_i2c_pm,
 	}
 };