mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 18:09:57 +00:00
iio: chemical: bme680: use FIELD_GET macro
Use the FIELD_GET macro instead of explicit mask and shift. Signed-off-by: David Frey <dpfrey@gmail.com> Reviewed-by: Himanshu Jha <himanshujha199640@gmail.com> Tested-by: Himanshu Jha <himanshujha199640@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
8d3032c369
commit
3dcb60cd92
1 changed files with 2 additions and 2 deletions
|
@ -285,7 +285,7 @@ static int bme680_read_calib(struct bme680_data *data,
|
|||
dev_err(dev, "failed to read resistance heat range\n");
|
||||
return ret;
|
||||
}
|
||||
calib->res_heat_range = (tmp & BME680_RHRANGE_MASK) / 16;
|
||||
calib->res_heat_range = FIELD_GET(BME680_RHRANGE_MASK, tmp);
|
||||
|
||||
ret = regmap_read(data->regmap, BME680_REG_RES_HEAT_VAL, &tmp);
|
||||
if (ret < 0) {
|
||||
|
@ -299,7 +299,7 @@ static int bme680_read_calib(struct bme680_data *data,
|
|||
dev_err(dev, "failed to read range software error\n");
|
||||
return ret;
|
||||
}
|
||||
calib->range_sw_err = (tmp & BME680_RSERROR_MASK) / 16;
|
||||
calib->range_sw_err = FIELD_GET(BME680_RSERROR_MASK, tmp);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue