提交 d4f4158d 编写于 作者: D Dmitry Torokhov

Input: ad7879-i2c - wrap suspend and resume in CONFIG_PM_SLEEP

CONFIG_PM is defined when CONFIG_PM_SLEEP or CONFIG_PM_RUNTIME is defined,
however suspend and resume methods are only valid in the context of
CONFIG_PM_SLEEP. If only CONFIG_PM_RUNTIME is defined we get the following
warning (courtesy of Geerts randconfig builds):

	ad7879-i2c.c: warning: 'ad7879_i2c_resume' defined but not used
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 26e56eb2
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#define AD7879_DEVID 0x79 /* AD7879-1/AD7889-1 */ #define AD7879_DEVID 0x79 /* AD7879-1/AD7889-1 */
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int ad7879_i2c_suspend(struct device *dev) static int ad7879_i2c_suspend(struct device *dev)
{ {
struct i2c_client *client = to_i2c_client(dev); struct i2c_client *client = to_i2c_client(dev);
...@@ -36,9 +36,9 @@ static int ad7879_i2c_resume(struct device *dev) ...@@ -36,9 +36,9 @@ static int ad7879_i2c_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(ad7879_i2c_pm, ad7879_i2c_suspend, ad7879_i2c_resume); static SIMPLE_DEV_PM_OPS(ad7879_i2c_pm, ad7879_i2c_suspend, ad7879_i2c_resume);
#endif
/* All registers are word-sized. /* All registers are word-sized.
* AD7879 uses a high-byte first convention. * AD7879 uses a high-byte first convention.
...@@ -119,9 +119,7 @@ static struct i2c_driver ad7879_i2c_driver = { ...@@ -119,9 +119,7 @@ static struct i2c_driver ad7879_i2c_driver = {
.driver = { .driver = {
.name = "ad7879", .name = "ad7879",
.owner = THIS_MODULE, .owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &ad7879_i2c_pm, .pm = &ad7879_i2c_pm,
#endif
}, },
.probe = ad7879_i2c_probe, .probe = ad7879_i2c_probe,
.remove = __devexit_p(ad7879_i2c_remove), .remove = __devexit_p(ad7879_i2c_remove),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册