Skip to content

Commit e450e07

Browse files
yarlBjic23
authored andcommitted
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: 7d24517 ("iio: common: st_sensors: check odr address value in st_sensors_set_odr()") Signed-off-by: Lary Gibaud <[email protected]> Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 3b7f9db commit e450e07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/common/st_sensors/st_sensors_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int st_sensors_set_odr(struct iio_dev *indio_dev, unsigned int odr)
7979
struct st_sensor_odr_avl odr_out = {0, 0};
8080
struct st_sensor_data *sdata = iio_priv(indio_dev);
8181

82-
if (!sdata->sensor_settings->odr.addr)
82+
if (!sdata->sensor_settings->odr.mask)
8383
return 0;
8484

8585
err = st_sensors_match_odr(sdata->sensor_settings, odr, &odr_out);

0 commit comments

Comments
 (0)