w1: w1_therm: Fix conversion result for negative temperatures
raspberrypi inclusion category: feature bugzilla: 50432 -------------------------------- commit 2f6055c2 upstream. DS18B20 device driver returns an incorrect value for negative temperatures due to a missing sign-extension in w1_DS18B20_convert_temp(). Fix by using s16 temperature value when converting to int. See: https://github.com/raspberrypi/linux/issues/4124 Fixes: 9ace0b4d (w1: w1_therm: Add support for GXCAS GX20MH01 device.) Cc: stable <stable@vger.kernel.org> Reported-by: NPaweł Marciniak <sunwire@gmail.com> Signed-off-by: NIvan Zaentsev <ivan.zaentsev@wirenboard.ru> Link: https://lore.kernel.org/r/20210121093021.224764-1-ivan.zaentsev@wirenboard.ruSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: NFang Yafen <yafen@iscas.ac.cn> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Showing
想要评论请 注册 或 登录