Skip to content

Commit 5a2c6bf

Browse files
jilaypandyakartben
authored andcommitted
drivers: stepper: adi: tmc2209 allow instantiation of tmc2209 without msx
The current implementation of tmc2209 driver does not allow instantiation of the driver without configuring msx pins. Signed-off-by: Jilay Pandya <[email protected]>
1 parent a1ad0ad commit 5a2c6bf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/stepper/adi_tmc/adi_tmc22xx_stepper_controller.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,9 @@ static DEVICE_API(stepper, tmc22xx_stepper_api) = {
172172
static const struct tmc22xx_config tmc22xx_config_##inst = { \
173173
.common = STEP_DIR_STEPPER_DT_INST_COMMON_CONFIG_INIT(inst), \
174174
.enable_pin = GPIO_DT_SPEC_INST_GET(inst, enable_gpios), \
175-
.msx_pins = DT_INST_NODE_HAS_PROP(inst, msx_gpios) \
176-
? tmc22xx_stepper_msx_pins_##inst \
177-
: NULL, \
178175
.msx_resolutions = msx_table, \
176+
IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, msx_gpios), \
177+
(.msx_pins = tmc22xx_stepper_msx_pins_##inst)) \
179178
}; \
180179
static struct tmc22xx_data tmc22xx_data_##inst = { \
181180
.common = STEP_DIR_STEPPER_DT_INST_COMMON_DATA_INIT(inst), \

0 commit comments

Comments
 (0)