@@ -171,9 +171,24 @@ static void bmc150_acpi_dual_accel_probe(struct i2c_client *client) {}
static void bmc150_acpi_dual_accel_remove(struct i2c_client *client) {}
#endif
-static int bmc150_accel_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static const struct i2c_device_id bmc150_accel_id[] = {
+ {"bma222"},
+ {"bma222e"},
+ {"bma250e"},
+ {"bma253"},
+ {"bma254"},
+ {"bma255"},
+ {"bma280"},
+ {"bmc150_accel"},
+ {"bmc156_accel", BOSCH_BMC156},
+ {"bmi055_accel"},
+ {}
+};
+MODULE_DEVICE_TABLE(i2c, bmc150_accel_id);
+
+static int bmc150_accel_probe(struct i2c_client *client)
{
+ const struct i2c_device_id *id = i2c_match_id(bmc150_accel_id, client);
struct regmap *regmap;
const char *name = NULL;
enum bmc150_type type = BOSCH_UNKNOWN;
@@ -231,22 +246,6 @@ static const struct acpi_device_id bmc150_accel_acpi_match[] = {
};
MODULE_DEVICE_TABLE(acpi, bmc150_accel_acpi_match);
-static const struct i2c_device_id bmc150_accel_id[] = {
- {"bma222"},
- {"bma222e"},
- {"bma250e"},
- {"bma253"},
- {"bma254"},
- {"bma255"},
- {"bma280"},
- {"bmc150_accel"},
- {"bmc156_accel", BOSCH_BMC156},
- {"bmi055_accel"},
- {}
-};
-
-MODULE_DEVICE_TABLE(i2c, bmc150_accel_id);
-
static const struct of_device_id bmc150_accel_of_match[] = {
{ .compatible = "bosch,bma222" },
{ .compatible = "bosch,bma222e" },
@@ -269,7 +268,7 @@ static struct i2c_driver bmc150_accel_driver = {
.acpi_match_table = ACPI_PTR(bmc150_accel_acpi_match),
.pm = &bmc150_accel_pm_ops,
},
- .probe = bmc150_accel_probe,
+ .probe_new = bmc150_accel_probe,
.remove = bmc150_accel_remove,
.id_table = bmc150_accel_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/bmc150-accel-i2c.c | 37 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 19 deletions(-)