if (i == ARRAY_SIZE(hts221_odr_table))
return -EINVAL;
- /* enable Block Data Update */
- err = hts221_write_with_mask(hw, HTS221_REG_CNTRL1_ADDR,
- HTS221_BDU_MASK, 1);
- if (err < 0)
- return err;
-
err = hts221_write_with_mask(hw, HTS221_REG_CNTRL1_ADDR,
HTS221_ODR_MASK, hts221_odr_table[i].val);
if (err < 0)
iio_dev->name = HTS221_DEV_NAME;
iio_dev->info = &hts221_info;
+ /* enable Block Data Update */
+ err = hts221_write_with_mask(hw, HTS221_REG_CNTRL1_ADDR,
+ HTS221_BDU_MASK, 1);
+ if (err < 0)
+ return err;
+
/* configure humidity sensor */
err = hts221_parse_rh_caldata(hw);
if (err < 0) {