Skip to content

Commit ce2d16b

Browse files
ubiedakartben
authored andcommitted
sensor: adxl345: Fix conditional instantiation of RTIO ctx and IODEV
With actual parameter to determine whether the driver requires it: Streaming mode enabled. Signed-off-by: Luis Ubieda <luisf@croxel.com>
1 parent dd3c66c commit ce2d16b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/sensor/adi/adxl345/adxl345.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,8 @@ static int adxl345_init(const struct device *dev)
594594
#define ADXL345_DEFINE(inst) \
595595
IF_ENABLED(CONFIG_ADXL345_STREAM, (ADXL345_RTIO_DEFINE(inst))); \
596596
static struct adxl345_dev_data adxl345_data_##inst = { \
597-
COND_CODE_1(adxl345_iodev_##inst, (.rtio_ctx = &adxl345_rtio_ctx_##inst, \
598-
.iodev = &adxl345_iodev_##inst,), ()) \
597+
IF_ENABLED(CONFIG_ADXL345_STREAM, (.rtio_ctx = &adxl345_rtio_ctx_##inst, \
598+
.iodev = &adxl345_iodev_##inst,)) \
599599
}; \
600600
static const struct adxl345_dev_config adxl345_config_##inst = \
601601
COND_CODE_1(DT_INST_ON_BUS(inst, spi), (ADXL345_CONFIG_SPI(inst)), \

0 commit comments

Comments
 (0)