From: Nikolaus Schulz Date: Wed, 8 Feb 2012 17:56:10 +0000 (+0100) Subject: hwmon: (f75375s) Fix bit shifting in f75375_write16 X-Git-Tag: v3.0.22~13 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=eafbec56be4c3cfd8f3b5098a0c5f7397a1e48b0;p=karo-tx-linux.git hwmon: (f75375s) Fix bit shifting in f75375_write16 commit eb2f255b2d360df3f500042a2258dcf2fcbe89a2 upstream. 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 Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c index 95cbfb3a7077..dcfd9e1ff0e0 100644 --- a/drivers/hwmon/f75375s.c +++ b/drivers/hwmon/f75375s.c @@ -159,7 +159,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));