iio: st_sensors: rely on odr mask to know if odr can be set
commit5ea5de62b7b552d292b75e9ef55a28b4654a938f
authorLary Gibaud <yarl-baudig@mailoo.org>
Sat, 11 Apr 2020 15:16:06 +0000 (11 17:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Apr 2020 14:31:24 +0000 (29 16:31 +0200)
treeb519e9188c39de92a7e5d53f16a77bcd91ec3634
parentee7ab2118a64d08add22e6c198dd1a36d0be02c7
iio: st_sensors: rely on odr mask to know if odr can be set

commit e450e07c14abae563ad13b064cbce9fdccc6bc8d upstream.

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: 7d245172675a ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/common/st_sensors/st_sensors_core.c