summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/ad7414.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-04 07:53:16 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-04 07:53:16 -0700
commit46e85f5f1c2a1d106c1ec0fa2a06280276b8e052 (patch)
tree6b894b2c2c13fe70f986b03b32c9ca2a6d36a053 /drivers/hwmon/ad7414.c
parentb2409fb6a49d1f633a8fc488e48043da7d3fd6a7 (diff)
parenteff7687d473c31cba3876c13e97eebc708eb8582 (diff)
downloadtalos-op-linux-46e85f5f1c2a1d106c1ec0fa2a06280276b8e052.tar.gz
talos-op-linux-46e85f5f1c2a1d106c1ec0fa2a06280276b8e052.zip
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: hwmon: (w83627ehf) Add support for the W83627UHG hwmon: (w83627ehf) Clean up probe function hwmon: (w83627ehf) Properly report PECI and AMD-SI sensor types hwmon: Use i2c_smbus_{read,write}_word_swapped hwmon: (smsc47b397) Fix checkpatch errors hwmon: (lm90) Make code more readable hwmon: (lm90) Fix warnings hwmon: (ibmaem) Avoid repeated memory allocations hwmon: (ibmaem) Make instance initializations independent hwmon: (ibmaem) Fix error paths hwmon: (lm73) Make detection less problematic hwmon: Avoid building drivers for powerpc that read/write ISA addresses
Diffstat (limited to 'drivers/hwmon/ad7414.c')
-rw-r--r--drivers/hwmon/ad7414.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/hwmon/ad7414.c b/drivers/hwmon/ad7414.c
index d46c0c758ddf..df29a7fff9e7 100644
--- a/drivers/hwmon/ad7414.c
+++ b/drivers/hwmon/ad7414.c
@@ -58,10 +58,9 @@ static inline int ad7414_temp_from_reg(s16 reg)
static inline int ad7414_read(struct i2c_client *client, u8 reg)
{
- if (reg == AD7414_REG_TEMP) {
- int value = i2c_smbus_read_word_data(client, reg);
- return (value < 0) ? value : swab16(value);
- } else
+ if (reg == AD7414_REG_TEMP)
+ return i2c_smbus_read_word_swapped(client, reg);
+ else
return i2c_smbus_read_byte_data(client, reg);
}
OpenPOWER on IntegriCloud