From: Jonathan Cameron <jic23@kernel.org>
To: Angel Iglesias <ang.iglesiasg@gmail.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Lars-Peter Clausen <lars@metafoo.de>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Paul Cercueil <paul@crapouillou.net>,
Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH v2 2/2] iio: pressure: bmp280: convert to i2c's .probe_new()
Date: Sun, 6 Nov 2022 17:25:10 +0000 [thread overview]
Message-ID: <20221106172510.144f7bf4@jic23-huawei> (raw)
In-Reply-To: <237d16807630c6f2a9d2864521228b9d837984b6.1667750698.git.ang.iglesiasg@gmail.com>
On Sun, 6 Nov 2022 17:43:16 +0100
Angel Iglesias <ang.iglesiasg@gmail.com> wrote:
> Use i2c_client_get_device_id() to get the i2c_device_id* parameter in the
> .new_probe() callback.
>
> Signed-off-by: Angel Iglesias <ang.iglesiasg@gmail.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
I'm fine with Wolfram picking this up as an example of using the new code,
or I can take it through IIO after merging Wolfram's immutable branch.
So for option 1:
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> diff --git a/drivers/iio/pressure/bmp280-i2c.c b/drivers/iio/pressure/bmp280-i2c.c
> index 0c27211f3ea0..14eab086d24a 100644
> --- a/drivers/iio/pressure/bmp280-i2c.c
> +++ b/drivers/iio/pressure/bmp280-i2c.c
> @@ -5,11 +5,11 @@
>
> #include "bmp280.h"
>
> -static int bmp280_i2c_probe(struct i2c_client *client,
> - const struct i2c_device_id *id)
> +static int bmp280_i2c_probe(struct i2c_client *client)
> {
> struct regmap *regmap;
> const struct regmap_config *regmap_config;
> + const struct i2c_device_id *id = i2c_client_get_device_id(client);
>
> switch (id->driver_data) {
> case BMP180_CHIP_ID:
> @@ -65,7 +65,7 @@ static struct i2c_driver bmp280_i2c_driver = {
> .of_match_table = bmp280_of_i2c_match,
> .pm = pm_ptr(&bmp280_dev_pm_ops),
> },
> - .probe = bmp280_i2c_probe,
> + .probe_new = bmp280_i2c_probe,
> .id_table = bmp280_i2c_id,
> };
> module_i2c_driver(bmp280_i2c_driver);
prev parent reply other threads:[~2022-11-06 17:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-06 16:41 [PATCH v2 0/2] i2c: core: Introduce i2c_client_get_device_id helper Angel Iglesias
2022-11-06 16:42 ` [PATCH v2 1/2] i2c: core: Introduce i2c_client_get_device_id helper function Angel Iglesias
2022-11-06 17:22 ` Jonathan Cameron
2022-11-06 17:50 ` Angel Iglesias
2022-11-06 16:43 ` [PATCH v2 2/2] iio: pressure: bmp280: convert to i2c's .probe_new() Angel Iglesias
2022-11-06 17:25 ` Jonathan Cameron [this message]
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=20221106172510.144f7bf4@jic23-huawei \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ang.iglesiasg@gmail.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul@crapouillou.net \
--cc=rafael.j.wysocki@intel.com \
--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