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


Groups > linux.kernel > #1184748

[PATCH 3/4] Input: tsc2005 - simplify drvdata acquisition

From Sebastian Reichel <sre@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 3/4] Input: tsc2005 - simplify drvdata acquisition
Date 2015-07-15 14:20 +0200
Message-ID <pMtPl-7dE-45@gated-at.bofh.it> (permalink)
References <pMtPj-7dE-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Do not convert device to spi_device just for getting
the driver data, since spi_get_drvdata() just calls
dev_get_drvdata().

Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/input/touchscreen/tsc2005.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c
index 0aec45a..83508d8 100644
--- a/drivers/input/touchscreen/tsc2005.c
+++ b/drivers/input/touchscreen/tsc2005.c
@@ -354,8 +354,7 @@ static ssize_t tsc2005_selftest_show(struct device *dev,
 				     struct device_attribute *attr,
 				     char *buf)
 {
-	struct spi_device *spi = to_spi_device(dev);
-	struct tsc2005 *ts = spi_get_drvdata(spi);
+	struct tsc2005 *ts = dev_get_drvdata(dev);
 	unsigned int temp_high;
 	unsigned int temp_high_orig;
 	unsigned int temp_high_test;
@@ -440,8 +439,7 @@ static umode_t tsc2005_attr_is_visible(struct kobject *kobj,
 				      struct attribute *attr, int n)
 {
 	struct device *dev = container_of(kobj, struct device, kobj);
-	struct spi_device *spi = to_spi_device(dev);
-	struct tsc2005 *ts = spi_get_drvdata(spi);
+	struct tsc2005 *ts = dev_get_drvdata(dev);
 	umode_t mode = attr->mode;
 
 	if (attr == &dev_attr_selftest.attr) {
@@ -729,8 +727,7 @@ static int tsc2005_remove(struct spi_device *spi)
 
 static int __maybe_unused tsc2005_suspend(struct device *dev)
 {
-	struct spi_device *spi = to_spi_device(dev);
-	struct tsc2005 *ts = spi_get_drvdata(spi);
+	struct tsc2005 *ts = dev_get_drvdata(dev);
 
 	mutex_lock(&ts->mutex);
 
@@ -746,8 +743,7 @@ static int __maybe_unused tsc2005_suspend(struct device *dev)
 
 static int __maybe_unused tsc2005_resume(struct device *dev)
 {
-	struct spi_device *spi = to_spi_device(dev);
-	struct tsc2005 *ts = spi_get_drvdata(spi);
+	struct tsc2005 *ts = dev_get_drvdata(dev);
 
 	mutex_lock(&ts->mutex);
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] [input] tsc2005 cleanup Sebastian Reichel <sre@kernel.org> - 2015-07-15 14:20 +0200
  [PATCH 1/4] Input: tsc2005 - improve readability of register defines Sebastian Reichel <sre@kernel.org> - 2015-07-15 14:20 +0200
  [PATCH 4/4] Input: tsc2005 - convert to gpiod Sebastian Reichel <sre@kernel.org> - 2015-07-15 14:20 +0200
    Re: [PATCH 4/4] Input: tsc2005 - convert to gpiod Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-07-15 23:40 +0200
      Re: [PATCH 4/4] Input: tsc2005 - convert to gpiod Sebastian Reichel <sre@kernel.org> - 2015-07-16 00:10 +0200
        Re: [PATCH 4/4] Input: tsc2005 - convert to gpiod Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-07-16 02:30 +0200
  [PATCH 2/4] Input: tsc2005 - convert to regmap Sebastian Reichel <sre@kernel.org> - 2015-07-15 14:20 +0200
    Re: [PATCH 2/4] Input: tsc2005 - convert to regmap Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-07-15 23:40 +0200
      Re: [PATCH 2/4] Input: tsc2005 - convert to regmap Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-07-15 23:50 +0200
      Re: [PATCH 2/4] Input: tsc2005 - convert to regmap Sebastian Reichel <sre@kernel.org> - 2015-07-16 00:00 +0200
  [PATCH 3/4] Input: tsc2005 - simplify drvdata acquisition Sebastian Reichel <sre@kernel.org> - 2015-07-15 14:20 +0200
    Re: [PATCH 3/4] Input: tsc2005 - simplify drvdata acquisition Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-07-15 23:40 +0200
      Re: [PATCH 3/4] Input: tsc2005 - simplify drvdata acquisition Sebastian Reichel <sre@kernel.org> - 2015-07-16 00:10 +0200
        Re: [PATCH 3/4] Input: tsc2005 - simplify drvdata acquisition Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-07-16 02:30 +0200

csiph-web