From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Subject: [PATCH 1/6] iio:pressure:ms5637: switch to probe_new
Date: Thu, 10 Dec 2020 00:48:52 +0100 [thread overview]
Message-ID: <20201209234857.1521453-2-alexandre.belloni@bootlin.com> (raw)
In-Reply-To: <20201209234857.1521453-1-alexandre.belloni@bootlin.com>
Switch to the modern i2c probe_new callback and drop the i2c_device_id
array.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
drivers/iio/pressure/ms5637.c | 25 +++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)
diff --git a/drivers/iio/pressure/ms5637.c b/drivers/iio/pressure/ms5637.c
index 5b59a4137d32..7c3f0ccd917c 100644
--- a/drivers/iio/pressure/ms5637.c
+++ b/drivers/iio/pressure/ms5637.c
@@ -126,8 +126,7 @@ static const struct iio_info ms5637_info = {
.attrs = &ms5637_attribute_group,
};
-static int ms5637_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static int ms5637_probe(struct i2c_client *client)
{
struct ms_tp_dev *dev_data;
struct iio_dev *indio_dev;
@@ -152,7 +151,7 @@ static int ms5637_probe(struct i2c_client *client,
mutex_init(&dev_data->lock);
indio_dev->info = &ms5637_info;
- indio_dev->name = id->name;
+ indio_dev->name = device_get_match_data(&client->dev);
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->channels = ms5637_channels;
indio_dev->num_channels = ARRAY_SIZE(ms5637_channels);
@@ -170,27 +169,17 @@ static int ms5637_probe(struct i2c_client *client,
return devm_iio_device_register(&client->dev, indio_dev);
}
-static const struct i2c_device_id ms5637_id[] = {
- {"ms5637", 0},
- {"ms5805", 0},
- {"ms5837", 0},
- {"ms8607-temppressure", 0},
- {}
-};
-MODULE_DEVICE_TABLE(i2c, ms5637_id);
-
static const struct of_device_id ms5637_of_match[] = {
- { .compatible = "meas,ms5637", },
- { .compatible = "meas,ms5805", },
- { .compatible = "meas,ms5837", },
- { .compatible = "meas,ms8607-temppressure", },
+ { .compatible = "meas,ms5637", .data = "ms5637" },
+ { .compatible = "meas,ms5805", .data = "ms5805" },
+ { .compatible = "meas,ms5837", .data = "ms5837" },
+ { .compatible = "meas,ms8607-temppressure", .data = "ms8607-temppressure" },
{ },
};
MODULE_DEVICE_TABLE(of, ms5637_of_match);
static struct i2c_driver ms5637_driver = {
- .probe = ms5637_probe,
- .id_table = ms5637_id,
+ .probe_new = ms5637_probe,
.driver = {
.name = "ms5637",
.of_match_table = ms5637_of_match,
--
2.28.0
next prev parent reply other threads:[~2020-12-09 23:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-09 23:48 [PATCH 0/6] iio:pressure:ms5637: add ms5803 support Alexandre Belloni
2020-12-09 23:48 ` Alexandre Belloni [this message]
2020-12-12 13:26 ` [PATCH 1/6] iio:pressure:ms5637: switch to probe_new Andy Shevchenko
2020-12-13 17:04 ` Jonathan Cameron
2020-12-09 23:48 ` [PATCH 2/6] iio:pressure:ms5637: introduce hardware differentiation Alexandre Belloni
2020-12-13 17:12 ` Jonathan Cameron
2020-12-13 19:51 ` Alexandre Belloni
2020-12-09 23:48 ` [PATCH 3/6] iio:pressure:ms5637: limit available sample frequencies Alexandre Belloni
2020-12-12 18:26 ` Andy Shevchenko
2020-12-13 17:17 ` Jonathan Cameron
2020-12-09 23:48 ` [PATCH 4/6] iio:common:ms_sensors:ms_sensors_i2c: rework CRC calculation helper Alexandre Belloni
2020-12-09 23:48 ` [PATCH 5/6] iio:common:ms_sensors:ms_sensors_i2c: add support for alternative PROM layout Alexandre Belloni
2020-12-13 17:20 ` Jonathan Cameron
2020-12-13 19:34 ` Alexandre Belloni
2020-12-09 23:48 ` [PATCH 6/6] iio:pressure:ms5637: add ms5803 support Alexandre Belloni
2020-12-11 3:34 ` Rob Herring
2020-12-11 8:08 ` Alexandre Belloni
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=20201209234857.1521453-2-alexandre.belloni@bootlin.com \
--to=alexandre.belloni@bootlin.com \
--cc=devicetree@vger.kernel.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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;
as well as URLs for NNTP newsgroup(s).