linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Javier Martinez Canillas <martinez.javier@gmail.com>
Cc: Henrik Rydberg <rydberg@euromail.se>,
	Mohan Pallaka <mpallaka@codeaurora.org>,
	Kevin McNeely <kev@cypress.com>,
	Shubhrajyoti Datta <omaplinuxkernel@gmail.com>,
	linux-input@vger.kernel.org
Subject: [PATCH 3/7] Input: cyttsp - guard PM methods with CONFIG_PM_SLEEP
Date: Mon, 14 Nov 2011 00:15:56 -0800	[thread overview]
Message-ID: <20111114081556.10141.73034.stgit@hammer.corenet.prv> (raw)
In-Reply-To: <20111114080939.10141.46174.stgit@hammer.corenet.prv>

This will prevent compiler from complaining about PM methods defined but
not used in case when CONFIG_PM_RUNTIME is defined but CONFIG_PM_SLEEP
is not.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/touchscreen/cyttsp_core.c |    2 +-
 drivers/input/touchscreen/cyttsp_core.h |    2 +-
 drivers/input/touchscreen/cyttsp_i2c.c  |    7 +++----
 drivers/input/touchscreen/cyttsp_spi.c  |    7 +++----
 4 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c
index 47a0958..54f36d6 100644
--- a/drivers/input/touchscreen/cyttsp_core.c
+++ b/drivers/input/touchscreen/cyttsp_core.c
@@ -592,7 +592,7 @@ bypass:
 	return retval;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 int cyttsp_resume(void *handle)
 {
 	struct cyttsp *ts = handle;
diff --git a/drivers/input/touchscreen/cyttsp_core.h b/drivers/input/touchscreen/cyttsp_core.h
index c4c7d9e..1a0fd9d 100644
--- a/drivers/input/touchscreen/cyttsp_core.h
+++ b/drivers/input/touchscreen/cyttsp_core.h
@@ -51,7 +51,7 @@ void *cyttsp_core_init(struct cyttsp_bus_ops *bus_ops,
 		       struct device *dev, int irq);
 
 void cyttsp_core_release(void *handle);
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 int cyttsp_resume(void *handle);
 int cyttsp_suspend(void *handle);
 #endif
diff --git a/drivers/input/touchscreen/cyttsp_i2c.c b/drivers/input/touchscreen/cyttsp_i2c.c
index d7d62d4..697c7a88 100644
--- a/drivers/input/touchscreen/cyttsp_i2c.c
+++ b/drivers/input/touchscreen/cyttsp_i2c.c
@@ -122,7 +122,7 @@ static int __devexit cyttsp_i2c_remove(struct i2c_client *client)
 	return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int cyttsp_i2c_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
@@ -138,9 +138,10 @@ static int cyttsp_i2c_resume(struct device *dev)
 
 	return cyttsp_resume(ts->ttsp_client);
 }
-static SIMPLE_DEV_PM_OPS(cyttsp_i2c_pm, cyttsp_i2c_suspend, cyttsp_i2c_resume);
 #endif
 
+static SIMPLE_DEV_PM_OPS(cyttsp_i2c_pm, cyttsp_i2c_suspend, cyttsp_i2c_resume);
+
 static const struct i2c_device_id cyttsp_i2c_id[] = {
 	{ CY_I2C_NAME, 0 },  { }
 };
@@ -149,9 +150,7 @@ static struct i2c_driver cyttsp_i2c_driver = {
 	.driver = {
 		.name = CY_I2C_NAME,
 		.owner = THIS_MODULE,
-#ifdef CONFIG_PM
 		.pm = &cyttsp_i2c_pm,
-#endif
 	},
 	.probe = cyttsp_i2c_probe,
 	.remove = __devexit_p(cyttsp_i2c_remove),
diff --git a/drivers/input/touchscreen/cyttsp_spi.c b/drivers/input/touchscreen/cyttsp_spi.c
index 1324695..8138a96 100644
--- a/drivers/input/touchscreen/cyttsp_spi.c
+++ b/drivers/input/touchscreen/cyttsp_spi.c
@@ -227,7 +227,7 @@ static int __devexit cyttsp_spi_remove(struct spi_device *spi)
 	return 0;
 }
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int cyttsp_spi_suspend(struct device *dev)
 {
 	struct cyttsp_spi *ts = dev_get_drvdata(dev);
@@ -241,16 +241,15 @@ static int cyttsp_spi_resume(struct device *dev)
 
 	return cyttsp_resume(ts->ttsp_client);
 }
-static SIMPLE_DEV_PM_OPS(cyttsp_spi_pm, cyttsp_spi_suspend, cyttsp_spi_resume);
 #endif
 
+static SIMPLE_DEV_PM_OPS(cyttsp_spi_pm, cyttsp_spi_suspend, cyttsp_spi_resume);
+
 static struct spi_driver cyttsp_spi_driver = {
 	.driver = {
 		.name = CY_SPI_NAME,
 		.owner = THIS_MODULE,
-#ifdef CONFIG_PM
 		.pm = &cyttsp_spi_pm,
-#endif
 	},
 	.probe = cyttsp_spi_probe,
 	.remove = __devexit_p(cyttsp_spi_remove),


  parent reply	other threads:[~2011-11-14  8:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-14  8:15 [PATCH 0/7] A few patches to cyttsp Dmitry Torokhov
2011-11-14  8:15 ` [PATCH 1/7] Input: cyttsp - move up into main touchscreen directory Dmitry Torokhov
2011-11-14  8:15 ` [PATCH 2/7] Input: cyttsp - rework Kconfig entries Dmitry Torokhov
2011-11-14  8:15 ` Dmitry Torokhov [this message]
2011-11-14  8:16 ` [PATCH 4/7] Input: cyttsp - device does not belong in bus structure Dmitry Torokhov
2011-11-14  8:16 ` [PATCH 5/7] Input: cyttsp - set up bus type in input device Dmitry Torokhov
2011-11-14  8:16 ` [PATCH 6/7] Input: cyttsp - use unified structure for ts object Dmitry Torokhov
2011-11-14  8:16 ` [PATCH 7/7] Input: cyttsp - consolidate PM methods Dmitry Torokhov
2011-11-16 19:17 ` [PATCH 0/7] A few patches to cyttsp Javier Martinez Canillas
2011-11-16 19:38   ` Dmitry Torokhov
2011-11-16 20:17     ` Javier Martinez Canillas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111114081556.10141.73034.stgit@hammer.corenet.prv \
    --to=dmitry.torokhov@gmail.com \
    --cc=kev@cypress.com \
    --cc=linux-input@vger.kernel.org \
    --cc=martinez.javier@gmail.com \
    --cc=mpallaka@codeaurora.org \
    --cc=omaplinuxkernel@gmail.com \
    --cc=rydberg@euromail.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).