@@ -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,
}
};
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(-)