[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 01 Jan 2023 12:06:08 +0100
From: Angel Iglesias <ang.iglesiasg@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-iio@...r.kernel.org, Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Nikita Yushchenko <nikita.yoush@...entembedded.com>,
Paul Cercueil <paul@...pouillou.net>,
Ulf Hansson <ulf.hansson@...aro.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Andreas Klinger <ak@...klinger.de>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/5] iio: pressure: bmp280: Add preinit callback
On Tue, 2022-12-27 at 23:41 +0200, Andy Shevchenko wrote:
> 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
The dangers of copying paste and rushing things etc. Sorry for this brain fart!
Thanks for your time,
Angel
> > if (ret < 0)
> > return ret;
>
> if (ret < 0)
> return dev_err_probe(...);
>
> > }
>
Powered by blists - more mailing lists