Input: eKTF2127: mark PM functions as __maybe_unused
Subsystems (2)
PATCH 1/1 Input: eKTF2127: mark PM functions as __maybe_unused
The newly added ektf2127 driver uses the SIMPLE_DEV_PM_OPS macro to conditionally refer to the resume/suspend functions, which causes a warning when CONFIG_PM_SLEEP is disabled:
drivers/input/touchscreen/ektf2127.c:168:12: error: 'ektf2127_resume' defined but not used [-Werror=unused-function] drivers/input/touchscreen/ektf2127.c:156:12: error: 'ektf2127_suspend' defined but not used [-Werror=unused-function]
We could either put these functions inside of an #ifdef or add __maybe_unused annotations. This uses the second approach, which is generally more foolproof.
--- drivers/input/touchscreen/ektf2127.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/input/touchscreen/ektf2127.c +2 -2
@@ -153,7 +153,7 @@ static void ektf2127_stop(struct input_dev *dev)gpiod_set_value_cansleep (ts->power_gpios,0 ); } -static int ektf2127_suspend (struct device *dev) +static int __maybe_unused ektf2127_suspend (struct device *dev) {struct ektf2127_ts *ts =i2c_get_clientdata (to_i2c_client (dev));
@@ -165,7 +165,7 @@ static int ektf2127_suspend(struct device *dev)return 0 ; } -static int ektf2127_resume (struct device *dev) +static int __maybe_unused ektf2127_resume (struct device *dev) {struct ektf2127_ts *ts =i2c_get_clientdata (to_i2c_client (dev));
Signature · 1 line
2.9.0
Quoted 7 lines · Arnd Bergmann
The newly added ektf2127 driver uses the
SIMPLE_DEV_PM_OPSmacro to conditionally refer to the resume/suspend functions, which causes a warning whenCONFIG_PM_SLEEPis disabled:
drivers/input/touchscreen/ektf2127.c:168:12: error: 'ektf2127_resume' defined but not used [-Werror=unused-function]drivers/input/touchscreen/ektf2127.c:156:12: error: 'ektf2127_suspend' defined but not used [-Werror=unused-function]
Quoted 6 lines
We could either put these functions inside of an #ifdef or add
__maybe_unusedannotations. This uses the second approach, which is generally more foolproof.Fixes 9ca5bf5029b6 ("Input: add support for Elan eKTF2127 touchscreen controller")Signed-off-by Arnd Bergmann <[email protected]>
Applied, thank you.
Quoted 29 lines
--- drivers/input/touchscreen/ektf2127.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/input/touchscreen/ektf2127.c +2
-2@@ -153,7 +153,7 @@ static void ektf2127_stop(struct input_dev *dev)gpiod_set_value_cansleep (ts->power_gpios,0 ); } -static int ektf2127_suspend (struct device *dev) +static int __maybe_unused ektf2127_suspend (struct device *dev) {struct ektf2127_ts *ts =i2c_get_clientdata (to_i2c_client (dev));@@ -165,7 +165,7 @@ static int ektf2127_suspend(struct device *dev)return 0 ; } -static int ektf2127_resume (struct device *dev) +static int __maybe_unused ektf2127_resume (struct device *dev) {struct ektf2127_ts *ts =i2c_get_clientdata (to_i2c_client (dev));Signature · 1 line
2.9.0
Signature · 1 line
Dmitry