@@ -18,9 +18,15 @@ static const struct regmap_config adxl372_regmap_config = {
.readable_noinc_reg = adxl372_readable_noinc_reg,
};
-static int adxl372_i2c_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static const struct i2c_device_id adxl372_i2c_id[] = {
+ { "adxl372", 0 },
+ {}
+};
+MODULE_DEVICE_TABLE(i2c, adxl372_i2c_id);
+
+static int adxl372_i2c_probe(struct i2c_client *client)
{
+ const struct i2c_device_id *id = i2c_match_id(adxl372_i2c_id, client);
struct regmap *regmap;
unsigned int regval;
int ret;
@@ -41,12 +47,6 @@ static int adxl372_i2c_probe(struct i2c_client *client,
return adxl372_probe(&client->dev, regmap, client->irq, id->name);
}
-static const struct i2c_device_id adxl372_i2c_id[] = {
- { "adxl372", 0 },
- {}
-};
-MODULE_DEVICE_TABLE(i2c, adxl372_i2c_id);
-
static const struct of_device_id adxl372_of_match[] = {
{ .compatible = "adi,adxl372" },
{ }
@@ -58,7 +58,7 @@ static struct i2c_driver adxl372_i2c_driver = {
.name = "adxl372_i2c",
.of_match_table = adxl372_of_match,
},
- .probe = adxl372_i2c_probe,
+ .probe_new = adxl372_i2c_probe,
.id_table = adxl372_i2c_id,
};
.probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in .probe(). The device_id array has to move up for that to work. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/iio/accel/adxl372_i2c.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)