summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/ad7314.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-04-27 19:50:56 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-04-27 19:50:56 -0700
commit9f7e2f9037ffa03f4c4cd6f19159a367e4e02f44 (patch)
treefe0b16b755eca36435be7932ea9a922df4c87973 /drivers/hwmon/ad7314.c
parenta882a4d053847f9fb148905f416fd85b20bb88fa (diff)
parentc3e40a9972428d6e2d8e287ed0233a57a218c30f (diff)
Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon patches from Guenter Roeck: - Fix build warning in ad7314 driver - Fix pci_device_id array access in fam15h_power driver, introduced by commit 00250ec90963 ("hwmon: fam15h_power: fix bogus values with current BIOSes") * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (fam15h_power) Fix pci_device_id array hwmon: (ad7314) Fix build warning
Diffstat (limited to 'drivers/hwmon/ad7314.c')
-rw-r--r--drivers/hwmon/ad7314.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/hwmon/ad7314.c b/drivers/hwmon/ad7314.c
index ce43642ef03..f85ce70d967 100644
--- a/drivers/hwmon/ad7314.c
+++ b/drivers/hwmon/ad7314.c
@@ -47,7 +47,7 @@ struct ad7314_data {
u16 rx ____cacheline_aligned;
};
-static int ad7314_spi_read(struct ad7314_data *chip, s16 *data)
+static int ad7314_spi_read(struct ad7314_data *chip)
{
int ret;
@@ -57,9 +57,7 @@ static int ad7314_spi_read(struct ad7314_data *chip, s16 *data)
return ret;
}
- *data = be16_to_cpu(chip->rx);
-
- return ret;
+ return be16_to_cpu(chip->rx);
}
static ssize_t ad7314_show_temperature(struct device *dev,
@@ -70,12 +68,12 @@ static ssize_t ad7314_show_temperature(struct device *dev,
s16 data;
int ret;
- ret = ad7314_spi_read(chip, &data);
+ ret = ad7314_spi_read(chip);
if (ret < 0)
return ret;
switch (spi_get_device_id(chip->spi_dev)->driver_data) {
case ad7314:
- data = (data & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET;
+ data = (ret & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET;
data = (data << 6) >> 6;
return sprintf(buf, "%d\n", 250 * data);
@@ -86,7 +84,7 @@ static ssize_t ad7314_show_temperature(struct device *dev,
* with a sign bit - which is a 14 bit 2's complement
* register. 1lsb - 31.25 milli degrees centigrade
*/
- data &= ADT7301_TEMP_MASK;
+ data = ret & ADT7301_TEMP_MASK;
data = (data << 2) >> 2;
return sprintf(buf, "%d\n",