Skip to contentSkip to conversation

Input: ads7846: Fix device usage within attribute show

PATCH Applied Alexander Stein 3 participants 3 messages Apr 11, 2014 – Apr 12, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: ads7846: Fix device usage within attribute show

With commit e585c40ba (Input: ads7846 - convert to hwmon_device_register_with_groups()) the device passed to the attribute's show function isn't the spi device as before.
So fixup the passed device to ads7846_read12_ser.

---
 drivers/input/touchscreen/ads7846.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/ads7846.c +1 -1
index 180ff7a..3824369 100644
@@ -425,7 +425,7 @@ static int ads7845_read12_ser(struct device *dev, unsigned command)
 name ## _show(struct device *dev, struct device_attribute *attr, char *buf) \
 { \
 	struct ads7846 *ts = dev_get_drvdata(dev); \
-	ssize_t v = ads7846_read12_ser(dev, \
+	ssize_t v = ads7846_read12_ser(&ts->spi->dev, \
 			READ_12BIT_SER(var)); \
 	if (v < 0) \
 		return v; \
Signature · 1 line
1.9.2
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Alexander Stein

With commit e585c40ba (Input: ads7846 - convert to hwmon_device_register_with_groups()) the device passed to the attribute's show function isn't the spi device as before.
So fixup the passed device to ads7846_read12_ser.

And I thought I got that right. Oh well.

Quoted 18 lines
---
  drivers/input/touchscreen/ads7846.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/ads7846.c +1 -1
index 180ff7a..3824369 100644
@@ -425,7 +425,7 @@ static int ads7845_read12_ser(struct device *dev, unsigned command)
  name ## _show(struct device *dev, struct device_attribute *attr, char *buf) \
  { \
  	struct ads7846 *ts = dev_get_drvdata(dev); \
-	ssize_t v = ads7846_read12_ser(dev, \
+	ssize_t v = ads7846_read12_ser(&ts->spi->dev, \
  			READ_12BIT_SER(var)); \
  	if (v < 0) \
  		return v; \
maintainer Applied
#2 lore raw
Quoted 11 lines · Guenter Roeck
Quoted 6 lines · Alexander Stein

With commit e585c40ba (Input: ads7846 - convert to hwmon_device_register_with_groups()) the device passed to the attribute's show function isn't the spi device as before.
So fixup the passed device to ads7846_read12_ser.

And I thought I got that right. Oh well.

Applied, thank you.

Signature · 1 line
Dmitry