[PATCH 00/17] Series short description

STALE5700d

Revision v1 of 2 in this series.

2 messages, 1 author, 2011-03-16 · open the first message on its own page

[PATCH 00/17] Series short description

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2011-03-16 07:12:57

The following series implements...

---

Dmitry Torokhov (17):
      Input: tsc2005 - remove 'disable' sysfs attribute
      Input: tsc2005 - add open/close
      Input: tsc2005 - handle read errors from SPI layer
      Input: tsc2005 - do not rearm timer in hardirq handler
      Input: tsc2005 - don't use work for 'pen up' handling
      Input: tsc2005 - do not use 0 in place of NULL
      Input: tsc2005 - use true/false for boolean variables
      Input: tsc2005 - hide selftest attribute if we can't reset
      Input: tsc2005 - rework driver initialization code
      Input: tsc2005 - set up bus type in input device
      Input: tsc2005 - set up parent device
      Input: tsc2005 - clear driver data after unbinding
      Input: tsc2005 - add module description
      Input: tsc2005 - remove driver banner message
      Input: tsc2005 - remove incorrect module alias
      Input: tsc2005 - convert to using dev_pm_ops
      Input: tsc2005 - use spi_get/set_drvdata()


 drivers/input/touchscreen/tsc2005.c |  659 +++++++++++++++++++----------------
 1 files changed, 349 insertions(+), 310 deletions(-)

-- 
Signature

[PATCH 01/17] Input: tsc2005 - use spi_get/set_drvdata()

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2011-03-16 07:12:58

Instead of peeking into underlying device and using dev_get/set_drvdata(),
let's use SPI layer's implementation to access driver-private data
(which may be different from driver-core private data).

Signed-off-by: Dmitry Torokhov <redacted>
---

 drivers/input/touchscreen/tsc2005.c |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c
index f95f968..5dad30a 100644
--- a/drivers/input/touchscreen/tsc2005.c
+++ b/drivers/input/touchscreen/tsc2005.c
@@ -366,7 +366,8 @@ static void tsc2005_enable(struct tsc2005 *ts)
 static ssize_t tsc2005_disable_show(struct device *dev,
 				    struct device_attribute *attr, char *buf)
 {
-	struct tsc2005 *ts = dev_get_drvdata(dev);
+	struct spi_device *spi = to_spi_device(dev);
+	struct tsc2005 *ts = spi_get_drvdata(spi);
 
 	return sprintf(buf, "%u\n", ts->disabled);
 }
@@ -375,7 +376,8 @@ static ssize_t tsc2005_disable_store(struct device *dev,
 				     struct device_attribute *attr,
 				     const char *buf, size_t count)
 {
-	struct tsc2005 *ts = dev_get_drvdata(dev);
+	struct spi_device *spi = to_spi_device(dev);
+	struct tsc2005 *ts = spi_get_drvdata(spi);
 	unsigned long res;
 	int i;
 
@@ -401,7 +403,8 @@ static ssize_t tsc2005_selftest_show(struct device *dev,
 				     struct device_attribute *attr,
 				     char *buf)
 {
-	struct tsc2005 *ts = dev_get_drvdata(dev);
+	struct spi_device *spi = to_spi_device(dev);
+	struct tsc2005 *ts = spi_get_drvdata(spi);
 	u16 temp_high;
 	u16 temp_high_orig;
 	u16 temp_high_test;
@@ -620,7 +623,7 @@ static int __devinit tsc2005_probe(struct spi_device *spi)
 	if (ts == NULL)
 		return -ENOMEM;
 
-	dev_set_drvdata(&spi->dev, ts);
+	spi_set_drvdata(spi, ts);
 	ts->spi = spi;
 	spi->dev.power.power_state = PMSG_ON;
 	spi->mode = SPI_MODE_0;
@@ -637,7 +640,7 @@ static int __devinit tsc2005_probe(struct spi_device *spi)
 
 static int __devexit tsc2005_remove(struct spi_device *spi)
 {
-	struct tsc2005 *ts = dev_get_drvdata(&spi->dev);
+	struct tsc2005 *ts = spi_get_drvdata(spi);
 
 	mutex_lock(&ts->mutex);
 	tsc2005_disable(ts);
@@ -661,7 +664,8 @@ static int __devexit tsc2005_remove(struct spi_device *spi)
 #ifdef CONFIG_PM
 static int tsc2005_suspend(struct spi_device *spi, pm_message_t mesg)
 {
-	struct tsc2005 *ts = dev_get_drvdata(&spi->dev);
+	struct spi_device *spi = to_spi_device(dev);
+	struct tsc2005 *ts = spi_get_drvdata(spi);
 
 	mutex_lock(&ts->mutex);
 	tsc2005_disable(ts);
@@ -672,7 +676,8 @@ static int tsc2005_suspend(struct spi_device *spi, pm_message_t mesg)
 
 static int tsc2005_resume(struct spi_device *spi)
 {
-	struct tsc2005 *ts = dev_get_drvdata(&spi->dev);
+	struct spi_device *spi = to_spi_device(dev);
+	struct tsc2005 *ts = spi_get_drvdata(spi);
 
 	mutex_lock(&ts->mutex);
 	tsc2005_enable(ts);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help