]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
hwmon: (f75375s) Fix bit shifting in f75375_write16
authorNikolaus Schulz <schulz@macnetix.de>
Wed, 8 Feb 2012 17:56:10 +0000 (18:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Feb 2012 20:48:10 +0000 (12:48 -0800)
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 <mail@microschulz.de>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/f75375s.c

index 95cbfb3a7077c5901c65b1cdb9de3281a93a45c8..dcfd9e1ff0e0e39c4e65a9889db1e98d06af64ea 100644 (file)
@@ -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));