iio: adc: at91-sama5d2_adc: fix up casting in at91_adc_read_info_raw()
This code is problematic because we're supposed to be writing an int but we instead write to only the high 16 bits. This doesn't work on big endian systems, and there is a potential that the bottom 16 bits are used without being initialized. Fixes: 23ec2774 ("iio: adc: at91-sama5d2_adc: add support for position and pressure channels") Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Tested-by: NEugen Hristev <eugen.hristev@microchip.com> Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com> Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Showing
想要评论请 注册 或 登录