From: Alexander Stein Date: Sat, 12 Apr 2014 20:42:24 +0000 (-0700) Subject: Input: ads7846 - fix device usage within attribute show X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2fdf4cd9a2afb113e566dfe6ee5df55ada8c0631;p=linux-beck.git 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. Signed-off-by: Alexander Stein Acked-by: Guenter Roeck Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 45a06e495ed2..7f8aa981500d 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; \