Commit 82546bf5 authored by Nikolaus Schulz's avatar Nikolaus Schulz Committed by Greg Kroah-Hartman

hwmon: (f75375s) Fix bit shifting in f75375_write16

commit eb2f255b 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: default avatarNikolaus Schulz <mail@microschulz.de>
Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 39141a87
...@@ -159,7 +159,7 @@ static inline void f75375_write8(struct i2c_client *client, u8 reg, ...@@ -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, static inline void f75375_write16(struct i2c_client *client, u8 reg,
u16 value) 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) if (err)
return; return;
i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF)); i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment