Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1494190 > unrolled thread

[PATCH] Input: eKTF2127: mark PM functions as __maybe_unused

Started byArnd Bergmann <arnd@arndb.de>
First post2016-09-30 18:30 +0200
Last post2016-10-01 00:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Input: eKTF2127: mark PM functions as __maybe_unused Arnd Bergmann <arnd@arndb.de> - 2016-09-30 18:30 +0200
    Re: [PATCH] Input: eKTF2127: mark PM functions as __maybe_unused Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-10-01 00:40 +0200

#1494190 — [PATCH] Input: eKTF2127: mark PM functions as __maybe_unused

FromArnd Bergmann <arnd@arndb.de>
Date2016-09-30 18:30 +0200
Subject[PATCH] Input: eKTF2127: mark PM functions as __maybe_unused
Message-ID<sn8Rb-4hC-5@gated-at.bofh.it>
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.

Fixes: 9ca5bf5029b6 ("Input: add support for Elan eKTF2127 touchscreen controller")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/input/touchscreen/ektf2127.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/ektf2127.c b/drivers/input/touchscreen/ektf2127.c
index 31a2dd7f38aa..0ed34ff787ce 100644
--- a/drivers/input/touchscreen/ektf2127.c
+++ b/drivers/input/touchscreen/ektf2127.c
@@ -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));
 
-- 
2.9.0

[toc] | [next] | [standalone]


#1494316

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2016-10-01 00:40 +0200
Message-ID<sneDf-880-3@gated-at.bofh.it>
In reply to#1494190
On Fri, Sep 30, 2016 at 06:22:33PM +0200, Arnd Bergmann wrote:
> 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.
> 
> Fixes: 9ca5bf5029b6 ("Input: add support for Elan eKTF2127 touchscreen controller")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thank you.

> ---
>  drivers/input/touchscreen/ektf2127.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/ektf2127.c b/drivers/input/touchscreen/ektf2127.c
> index 31a2dd7f38aa..0ed34ff787ce 100644
> --- a/drivers/input/touchscreen/ektf2127.c
> +++ b/drivers/input/touchscreen/ektf2127.c
> @@ -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));
>  
> -- 
> 2.9.0
> 

-- 
Dmitry

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web