summaryrefslogtreecommitdiff
path: root/drivers/iio/accel/adxl345_spi.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2022-02-22 12:00:03 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-02-26 22:10:56 +0300
commit024f5d4f0ac087f73732a3084bdea5029ab0ca6b (patch)
tree777110a32129ccb2ec25c8fd39917d41139cf75b /drivers/iio/accel/adxl345_spi.c
parent01676b0f3b625a9aa608d5b716898e9dba2fb63e (diff)
downloadlinux-024f5d4f0ac087f73732a3084bdea5029ab0ca6b.tar.xz
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_spi.c')
-rw-r--r--drivers/iio/accel/adxl345_spi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/accel/adxl345_spi.c b/drivers/iio/accel/adxl345_spi.c
index 9223302fdd46..72550132b1bb 100644
--- a/drivers/iio/accel/adxl345_spi.c
+++ b/drivers/iio/accel/adxl345_spi.c
@@ -46,8 +46,8 @@ static const struct spi_device_id adxl345_spi_id[] = {
MODULE_DEVICE_TABLE(spi, adxl345_spi_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 },
{ },
};