mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
iio: pressure: bmp280: Make read calibration callback optional
Newer models do not require read the calibration parameters and apply the compensation algorithms in the sensor. Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/bb1b95ab3f4e71d3c76543370325c5c9aaa07add.1676823250.git.ang.iglesiasg@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
c25ea00fef
commit
4d545f9649
1 changed files with 6 additions and 4 deletions
|
@ -1631,10 +1631,12 @@ int bmp280_common_probe(struct device *dev,
|
|||
* time once. They will not change.
|
||||
*/
|
||||
|
||||
ret = data->chip_info->read_calib(data);
|
||||
if (ret < 0)
|
||||
return dev_err_probe(data->dev, ret,
|
||||
"failed to read calibration coefficients\n");
|
||||
if (data->chip_info->read_calib) {
|
||||
ret = data->chip_info->read_calib(data);
|
||||
if (ret < 0)
|
||||
return dev_err_probe(data->dev, ret,
|
||||
"failed to read calibration coefficients\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Attempt to grab an optional EOC IRQ - only the BMP085 has this
|
||||
|
|
Loading…
Reference in a new issue