From: Nikolaus Schulz <schulz@macnetix.de>
Date: Wed, 8 Feb 2012 17:56:10 +0000 (+0100)
Subject: hwmon: (f75375s) Fix bit shifting in f75375_write16
X-Git-Tag: v3.3-rc4~38^2~1
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=eb2f255b2d360df3f500042a2258dcf2fcbe89a2;p=users%2Fhch%2Fuuid.git

hwmon: (f75375s) Fix bit shifting in f75375_write16

In order to extract the high byte of the 16-bit word, shift the word to
the right, not to the left.

Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
Cc: stable@kernel.org # 2.6.32+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
---

diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
index b3eef4474a98..0aabaaf359ac 100644
--- a/drivers/hwmon/f75375s.c
+++ b/drivers/hwmon/f75375s.c
@@ -172,7 +172,7 @@ static inline void f75375_write8(struct i2c_client *client, u8 reg,
 static inline void f75375_write16(struct i2c_client *client, u8 reg,
 		u16 value)
 {
-	int err = i2c_smbus_write_byte_data(client, reg, (value << 8));
+	int err = i2c_smbus_write_byte_data(client, reg, (value >> 8));
 	if (err)
 		return;
 	i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF));