[PATCH 1/6] iio:pressure:ms5637: switch to probe_new

Alexandre Belloni
2020-12-09T23:50:11Z

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