From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Angel Iglesias <ang.iglesiasg@gmail.com>
Cc: linux-iio@vger.kernel.org, Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Nikita Yushchenko <nikita.yoush@cogentembedded.com>,
Paul Cercueil <paul@crapouillou.net>,
Ulf Hansson <ulf.hansson@linaro.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Andreas Klinger <ak@it-klinger.de>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/5] iio: pressure: bmp280: Add preinit callback
Date: Tue, 27 Dec 2022 23:41:05 +0200 [thread overview]
Message-ID: <Y6tmcRlHCZTgT9jS@smile.fi.intel.com> (raw)
In-Reply-To: <724e92e64e6d91d48d762e804b430c716679bccb.1672062380.git.ang.iglesiasg@gmail.com>
On Mon, Dec 26, 2022 at 03:29:21PM +0100, Angel Iglesias wrote:
> Adds preinit callback to execute operations on probe before applying
> initial configuration.
...
> @@ -935,6 +936,7 @@ static const struct bmp280_chip_info bmp280_chip_info = {
> .read_temp = bmp280_read_temp,
> .read_press = bmp280_read_press,
> .read_calib = bmp280_read_calib,
> + .preinit = NULL,
> };
>
> static int bme280_chip_config(struct bmp280_data *data)
> @@ -979,6 +981,7 @@ static const struct bmp280_chip_info bme280_chip_info = {
> .read_press = bmp280_read_press,
> .read_humid = bmp280_read_humid,
> .read_calib = bme280_read_calib,
> + .preinit = NULL,
> };
Useless changes.
...
> @@ -1604,6 +1614,7 @@ static const struct bmp280_chip_info bmp180_chip_info = {
> .read_temp = bmp180_read_temp,
> .read_press = bmp180_read_press,
> .read_calib = bmp180_read_calib,
> + .preinit = NULL,
> };
Ditto.
...
> + /*
> + * Some chips like the BMP3xx have preinit tasks to run
> + * before applying the initial configuration.
> + */
> + if (data->chip_info->preinit) {
> + ret = data->chip_info->preinit(data);
> + dev_err(dev, "error running preinit tasks");
Huh?! I guess you wanted
> if (ret < 0)
> return ret;
if (ret < 0)
return dev_err_probe(...);
> }
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-12-27 21:41 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-26 14:29 [PATCH v2 0/5] Add support for pressure sensor Bosch BMP580 Angel Iglesias
2022-12-26 14:29 ` [PATCH v2 1/5] iio: pressure: bmp280: Add enumeration to handle chip variants Angel Iglesias
2022-12-27 21:37 ` Andy Shevchenko
2023-01-01 11:04 ` Angel Iglesias
2023-01-08 12:41 ` Jonathan Cameron
2022-12-30 18:14 ` Jonathan Cameron
2023-01-01 10:56 ` Angel Iglesias
2022-12-26 14:29 ` [PATCH v2 2/5] iio: pressure: bmp280: Add preinit callback Angel Iglesias
2022-12-27 21:41 ` Andy Shevchenko [this message]
2023-01-01 11:06 ` Angel Iglesias
2022-12-30 18:18 ` Jonathan Cameron
2023-01-01 11:09 ` Angel Iglesias
2022-12-26 14:29 ` [PATCH v2 3/5] iio: pressure: bmp280: Add support for new sensor BMP580 Angel Iglesias
2022-12-29 17:35 ` Christophe JAILLET
2022-12-29 18:23 ` Angel Iglesias
2022-12-30 18:22 ` Jonathan Cameron
2023-01-01 11:16 ` Angel Iglesias
2023-01-08 12:35 ` Jonathan Cameron
2023-01-12 10:38 ` Contact Bosch-Sensortec (BST/SA)
2022-12-30 18:45 ` Jonathan Cameron
2023-01-01 11:46 ` Angel Iglesias
2023-01-08 12:38 ` Jonathan Cameron
2022-12-26 14:29 ` [PATCH v2 4/5] dt-bindings: iio: pressure: bmp085: Add BMP580 compatible string Angel Iglesias
2022-12-27 8:11 ` Krzysztof Kozlowski
2022-12-26 14:29 ` [PATCH v2 5/5] iio: pressure: bmp280: Add nvmem operations for BMP580 Angel Iglesias
2022-12-30 18:49 ` Jonathan Cameron
2023-01-01 11:48 ` Angel Iglesias
2022-12-26 22:05 ` [PATCH v2 4/5] dt-bindings: iio: pressure: bmp085: Add BMP580 compatible string Rob Herring
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=Y6tmcRlHCZTgT9jS@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=ak@it-klinger.de \
--cc=ang.iglesiasg@gmail.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=nikita.yoush@cogentembedded.com \
--cc=paul@crapouillou.net \
--cc=rafael.j.wysocki@intel.com \
--cc=robh+dt@kernel.org \
--cc=ulf.hansson@linaro.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