diff mbox

Input: ads7846: Fix device usage within attribute show

Message ID 1397246613-26538-1-git-send-email-alexanders83@web.de (mailing list archive)
State New, archived
Headers show

Commit Message

Alexander Stein April 11, 2014, 8:03 p.m. UTC
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.

Signed-off-by: Alexander Stein <alexanders83@web.de>
---
 drivers/input/touchscreen/ads7846.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck April 11, 2014, 9:53 p.m. UTC | #1
On 04/11/2014 01:03 PM, Alexander Stein wrote:
> 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.
>
> Signed-off-by: Alexander Stein <alexanders83@web.de>

And I thought I got that right. Oh well.

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/input/touchscreen/ads7846.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
> index 180ff7a..3824369 100644
> --- a/drivers/input/touchscreen/ads7846.c
> +++ b/drivers/input/touchscreen/ads7846.c
> @@ -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; \
>

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov April 12, 2014, 8:43 p.m. UTC | #2
On Fri, Apr 11, 2014 at 02:53:16PM -0700, Guenter Roeck wrote:
> On 04/11/2014 01:03 PM, Alexander Stein wrote:
> >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.
> >
> >Signed-off-by: Alexander Stein <alexanders83@web.de>
> 
> And I thought I got that right. Oh well.
> 
> Acked-by: Guenter Roeck <linux@roeck-us.net>

Applied, thank you.
diff mbox

Patch

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 180ff7a..3824369 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -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; \