From: Angel Iglesias <ang.iglesiasg@gmail.com>
To: linux-iio@vger.kernel.org
Cc: Angel Iglesias <ang.iglesiasg@gmail.com>,
Jonathan Cameron <jic23@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Lars-Peter Clausen <lars@metafoo.de>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Alexandru Lazar <alazar@startmail.com>,
Andreas Klinger <ak@it-klinger.de>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v4 3/7] iio: pressure: bmp280: Make read calibration callback optional
Date: Sun, 19 Feb 2023 17:58:01 +0100 [thread overview]
Message-ID: <bb1b95ab3f4e71d3c76543370325c5c9aaa07add.1676823250.git.ang.iglesiasg@gmail.com> (raw)
In-Reply-To: <cover.1676823250.git.ang.iglesiasg@gmail.com>
Newer models do not require read the calibration parameters and apply the
compensation algorithms in the sensor.
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
index 6467034b1d3e..22addaaa5393 100644
--- a/drivers/iio/pressure/bmp280-core.c
+++ b/drivers/iio/pressure/bmp280-core.c
@@ -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
--
2.39.2
next prev parent reply other threads:[~2023-02-19 17:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-19 16:57 [PATCH v4 0/7] Add support for pressure sensor Bosch BMP580 Angel Iglesias
2023-02-19 16:57 ` [PATCH v4 1/7] iio: pressure: bmp280: Use chip_info pointers for each chip as driver data Angel Iglesias
2023-02-19 16:58 ` [PATCH v4 2/7] iio: pressure: bmp280: Add preinit callback Angel Iglesias
2023-02-19 16:58 ` Angel Iglesias [this message]
2023-02-19 17:03 ` [PATCH v4 4/7] iio: pressure: Kconfig: Delete misleading I2C reference on bmp280 title Angel Iglesias
2023-02-19 17:03 ` [PATCH v4 5/7] iio: pressure: bmp280: Add support for new sensor BMP580 Angel Iglesias
2023-02-19 17:03 ` [PATCH v4 6/7] dt-bindings: iio: pressure: bmp085: Add BMP580 compatible string Angel Iglesias
2023-02-19 17:03 ` [PATCH v4 7/7] iio: pressure: bmp280: Add nvmem operations for BMP580 Angel Iglesias
2023-02-26 13:31 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bb1b95ab3f4e71d3c76543370325c5c9aaa07add.1676823250.git.ang.iglesiasg@gmail.com \
--to=ang.iglesiasg@gmail.com \
--cc=ak@it-klinger.de \
--cc=alazar@startmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®