]> git.baikalelectronics.ru Git - kernel.git/commit
iio: st_sensors: rely on odr mask to know if odr can be set
authorLary Gibaud <yarl-baudig@mailoo.org>
Sat, 11 Apr 2020 15:16:06 +0000 (17:16 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Apr 2020 16:50:02 +0000 (17:50 +0100)
commit5babed9a405e8facd1805349bd07fc11d682d465
tree9ccae72fa156639e4da4ed8427f3d1a57c7b2192
parentcf8bf24ffffe56b9de1716c2e713cff3d2b66c2d
iio: st_sensors: rely on odr mask to know if odr can be set

Indeed, relying on addr being not 0 cannot work because some device have
their register to set odr at address 0. As a matter of fact, if the odr
can be set, then there is a mask.

Sensors with ODR register at address 0 are: lsm303dlh, lsm303dlhc, lsm303dlm

Fixes: 1739f6d65b7d ("iio: common: st_sensors: check odr address value in st_sensors_set_odr()")
Signed-off-by: Lary Gibaud <yarl-baudig@mailoo.org>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/common/st_sensors/st_sensors_core.c