* [PATCH 1/2] Input: mcs5000_ts - Protect PM functions with CONFIG_PM_SLEEP
@ 2014-07-30 16:17 Fabio Estevam
2014-07-30 16:17 ` [PATCH 2/2] Input: mcs5000_ts - Remove ifdef Fabio Estevam
0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2014-07-30 16:17 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: beomho.seo, linux-input, Fabio Estevam
From: Fabio Estevam <fabio.estevam@freescale.com>
When a kernel has CONFIG_PM=y and CONFIG_PM_SLEEP=n the following warnings are
seen:
drivers/input/touchscreen/mcs5000_ts.c:252:12: warning: 'mcs5000_ts_suspend' defined but not used [-Wunused-function]
static int mcs5000_ts_suspend(struct device *dev)
^
drivers/input/touchscreen/mcs5000_ts.c:262:12: warning: 'mcs5000_ts_resume' defined but not used [-Wunused-function]
static int mcs5000_ts_resume(struct device *dev)
Protect the suspend/resume functions with CONFIG_PM_SLEEP in order to fix these
build warnings.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/input/touchscreen/mcs5000_ts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/mcs5000_ts.c b/drivers/input/touchscreen/mcs5000_ts.c
index 00510a9..1fb760c 100644
--- a/drivers/input/touchscreen/mcs5000_ts.c
+++ b/drivers/input/touchscreen/mcs5000_ts.c
@@ -248,7 +248,7 @@ static int mcs5000_ts_probe(struct i2c_client *client,
return 0;
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int mcs5000_ts_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] Input: mcs5000_ts - Remove ifdef
2014-07-30 16:17 [PATCH 1/2] Input: mcs5000_ts - Protect PM functions with CONFIG_PM_SLEEP Fabio Estevam
@ 2014-07-30 16:17 ` Fabio Estevam
2014-07-31 6:01 ` Dmitry Torokhov
0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2014-07-30 16:17 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: beomho.seo, linux-input, Fabio Estevam
From: Fabio Estevam <fabio.estevam@freescale.com>
We can annonate the suspend/resume functions with '__maybe_unused' and get rid
of the ifdef, which makes the code smaller and simpler.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/input/touchscreen/mcs5000_ts.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/input/touchscreen/mcs5000_ts.c b/drivers/input/touchscreen/mcs5000_ts.c
index 1fb760c..8b47e1f 100644
--- a/drivers/input/touchscreen/mcs5000_ts.c
+++ b/drivers/input/touchscreen/mcs5000_ts.c
@@ -248,8 +248,7 @@ static int mcs5000_ts_probe(struct i2c_client *client,
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int mcs5000_ts_suspend(struct device *dev)
+static int __maybe_unused mcs5000_ts_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
@@ -259,7 +258,7 @@ static int mcs5000_ts_suspend(struct device *dev)
return 0;
}
-static int mcs5000_ts_resume(struct device *dev)
+static int __maybe_unused mcs5000_ts_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct mcs5000_ts_data *data = i2c_get_clientdata(client);
@@ -269,7 +268,6 @@ static int mcs5000_ts_resume(struct device *dev)
return 0;
}
-#endif
static SIMPLE_DEV_PM_OPS(mcs5000_ts_pm, mcs5000_ts_suspend, mcs5000_ts_resume);
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] Input: mcs5000_ts - Remove ifdef
2014-07-30 16:17 ` [PATCH 2/2] Input: mcs5000_ts - Remove ifdef Fabio Estevam
@ 2014-07-31 6:01 ` Dmitry Torokhov
0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2014-07-31 6:01 UTC (permalink / raw)
To: Fabio Estevam; +Cc: beomho.seo, linux-input, Fabio Estevam
On Wed, Jul 30, 2014 at 01:17:19PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> We can annonate the suspend/resume functions with '__maybe_unused' and get rid
> of the ifdef, which makes the code smaller and simpler.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Applied both, thank you.
> ---
> drivers/input/touchscreen/mcs5000_ts.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/input/touchscreen/mcs5000_ts.c b/drivers/input/touchscreen/mcs5000_ts.c
> index 1fb760c..8b47e1f 100644
> --- a/drivers/input/touchscreen/mcs5000_ts.c
> +++ b/drivers/input/touchscreen/mcs5000_ts.c
> @@ -248,8 +248,7 @@ static int mcs5000_ts_probe(struct i2c_client *client,
> return 0;
> }
>
> -#ifdef CONFIG_PM_SLEEP
> -static int mcs5000_ts_suspend(struct device *dev)
> +static int __maybe_unused mcs5000_ts_suspend(struct device *dev)
> {
> struct i2c_client *client = to_i2c_client(dev);
>
> @@ -259,7 +258,7 @@ static int mcs5000_ts_suspend(struct device *dev)
> return 0;
> }
>
> -static int mcs5000_ts_resume(struct device *dev)
> +static int __maybe_unused mcs5000_ts_resume(struct device *dev)
> {
> struct i2c_client *client = to_i2c_client(dev);
> struct mcs5000_ts_data *data = i2c_get_clientdata(client);
> @@ -269,7 +268,6 @@ static int mcs5000_ts_resume(struct device *dev)
>
> return 0;
> }
> -#endif
>
> static SIMPLE_DEV_PM_OPS(mcs5000_ts_pm, mcs5000_ts_suspend, mcs5000_ts_resume);
>
> --
> 1.9.1
>
--
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-07-31 6:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-30 16:17 [PATCH 1/2] Input: mcs5000_ts - Protect PM functions with CONFIG_PM_SLEEP Fabio Estevam
2014-07-30 16:17 ` [PATCH 2/2] Input: mcs5000_ts - Remove ifdef Fabio Estevam
2014-07-31 6:01 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).