summaryrefslogtreecommitdiff
path: root/drivers/iio/accel/adxl345_i2c.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-02-22 12:00:05 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-02-26 22:11:13 +0300
commit266be7cb11c75f930a5902bc6199ff50ca4282a1 (patch)
treebc4abdbe4cf19b8f00ccaed874e37faf7cc9c34f /drivers/iio/accel/adxl345_i2c.c
parentc1db3d5cab03a79947736c44fd33f19f234b14a0 (diff)
downloadlinux-266be7cb11c75f930a5902bc6199ff50ca4282a1.tar.xz
iio: accel: adxl345: Make use of device properties
Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Link: https://lore.kernel.org/r/20220222090009.2060-4-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/accel/adxl345_i2c.c')
-rw-r--r--drivers/iio/accel/adxl345_i2c.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c
index 1e42cf3a2991..391910df8daa 100644
--- a/drivers/iio/accel/adxl345_i2c.c
+++ b/drivers/iio/accel/adxl345_i2c.c
@@ -19,19 +19,15 @@ static const struct regmap_config adxl345_i2c_regmap_config = {
.val_bits = 8,
};
-static int adxl345_i2c_probe(struct i2c_client *client,
- const struct i2c_device_id *id)
+static int adxl345_i2c_probe(struct i2c_client *client)
{
struct regmap *regmap;
- if (!id)
- return -ENODEV;
-
regmap = devm_regmap_init_i2c(client, &adxl345_i2c_regmap_config);
if (IS_ERR(regmap))
return dev_err_probe(&client->dev, PTR_ERR(regmap), "Error initializing regmap\n");
- return adxl345_core_probe(&client->dev, regmap, id->driver_data);
+ return adxl345_core_probe(&client->dev, regmap);
}
static const struct i2c_device_id adxl345_i2c_id[] = {
@@ -55,7 +51,7 @@ static struct i2c_driver adxl345_i2c_driver = {
.name = "adxl345_i2c",
.of_match_table = adxl345_of_match,
},
- .probe = adxl345_i2c_probe,
+ .probe_new = adxl345_i2c_probe,
.id_table = adxl345_i2c_id,
};