提交 4538bfbf 编写于 作者: J Jared Bents 提交者: Guenter Roeck

hwmon: (amc6821) sign extension temperature

Converts the unsigned temperature values from the i2c read
to be sign extended as defined in the datasheet so that
negative temperatures are properly read.

Fixes: 28e6274d ("hwmon: (amc6821) Avoid forward declaration")
Signed-off-by: NJared Bents <jared.bents@rockwellcollins.com>
Signed-off-by: NMatt Weber <matthew.weber@rockwellcollins.com>
[groeck: Dropped unnecessary continuation line]
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 13edb767
......@@ -188,8 +188,8 @@ static struct amc6821_data *amc6821_update_device(struct device *dev)
!data->valid) {
for (i = 0; i < TEMP_IDX_LEN; i++)
data->temp[i] = i2c_smbus_read_byte_data(client,
temp_reg[i]);
data->temp[i] = (int8_t)i2c_smbus_read_byte_data(
client, temp_reg[i]);
data->stat1 = i2c_smbus_read_byte_data(client,
AMC6821_REG_STAT1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册