diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-02-22 10:00:03 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-02-26 20:10:56 +0100 |
commit | 024f5d4f0ac087f73732a3084bdea5029ab0ca6b (patch) | |
tree | 777110a32129ccb2ec25c8fd39917d41139cf75b /drivers/iio/accel/adxl345_i2c.c | |
parent | iio: accel: adxl345: Convert to use dev_err_probe() (diff) | |
download | linux-024f5d4f0ac087f73732a3084bdea5029ab0ca6b.tar.xz linux-024f5d4f0ac087f73732a3084bdea5029ab0ca6b.zip |
iio: accel: adxl345: Set driver_data for OF enumeration
In order to enable this driver on mode platforms, assign driver_data
field in the OF device ID table.
While at it, make sure that device type is not 0 which may be wrongly
interpreted by device property APIs in the future.
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-2-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/accel/adxl345_i2c.c b/drivers/iio/accel/adxl345_i2c.c index e3205dce91b8..4c6efe2eefc1 100644 --- a/drivers/iio/accel/adxl345_i2c.c +++ b/drivers/iio/accel/adxl345_i2c.c @@ -44,8 +44,8 @@ static const struct i2c_device_id adxl345_i2c_id[] = { MODULE_DEVICE_TABLE(i2c, adxl345_i2c_id); static const struct of_device_id adxl345_of_match[] = { - { .compatible = "adi,adxl345" }, - { .compatible = "adi,adxl375" }, + { .compatible = "adi,adxl345", .data = (const void *)ADXL345 }, + { .compatible = "adi,adxl375", .data = (const void *)ADXL375 }, { }, }; |