diff options
Diffstat (limited to 'drivers/iio/accel/adxl355_i2c.c')
| -rw-r--r-- | drivers/iio/accel/adxl355_i2c.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/iio/accel/adxl355_i2c.c b/drivers/iio/accel/adxl355_i2c.c index 6cde5ccac06b..1a512c7b792b 100644 --- a/drivers/iio/accel/adxl355_i2c.c +++ b/drivers/iio/accel/adxl355_i2c.c @@ -24,19 +24,10 @@ static int adxl355_i2c_probe(struct i2c_client *client) { struct regmap *regmap; const struct adxl355_chip_info *chip_data; - const struct i2c_device_id *adxl355; - chip_data = device_get_match_data(&client->dev); - if (!chip_data) { - adxl355 = to_i2c_driver(client->dev.driver)->id_table; - if (!adxl355) - return -EINVAL; - - chip_data = (void *)i2c_match_id(adxl355, client)->driver_data; - - if (!chip_data) - return -EINVAL; - } + chip_data = i2c_get_match_data(client); + if (!chip_data) + return -ENODEV; regmap = devm_regmap_init_i2c(client, &adxl355_i2c_regmap_config); if (IS_ERR(regmap)) { @@ -68,7 +59,7 @@ static struct i2c_driver adxl355_i2c_driver = { .name = "adxl355_i2c", .of_match_table = adxl355_of_match, }, - .probe_new = adxl355_i2c_probe, + .probe = adxl355_i2c_probe, .id_table = adxl355_i2c_id, }; module_i2c_driver(adxl355_i2c_driver); @@ -76,4 +67,4 @@ module_i2c_driver(adxl355_i2c_driver); MODULE_AUTHOR("Puranjay Mohan <puranjay12@gmail.com>"); MODULE_DESCRIPTION("ADXL355 3-Axis Digital Accelerometer I2C driver"); MODULE_LICENSE("GPL v2"); -MODULE_IMPORT_NS(IIO_ADXL355); +MODULE_IMPORT_NS("IIO_ADXL355"); |
