I am getting an error when trying to compile my custom kscan, due to an error in the expansion of this macro (error and devicetree bindings attached in next message):
#define KSCAN_JOYSTICK_INIT(n) \
static struct kscan_joystick_data kscan_joystick_data_##n = {}; \
\
static const struct kscan_joystick_config kscan_joystick_config_##n = { \
.idle_period_ms = DT_INST_PROP_OR(n, idle_period_ms, 100), \
.poll_period_ms = DT_INST_PROP_OR(n, poll_period_ms, 10), \
.adc_0 = ADC_DT_SPEC_GET_BY_IDX(DT_DRV_INST(n), 0), \
.adc_1 = ADC_DT_SPEC_GET_BY_IDX(DT_DRV_INST(n), 1), \
.angle_offset = DT_INST_PROP_OR(n, angle_offset, 0), \
}; \
\
PM_DEVICE_DT_INST_DEFINE(n, kscan_joystick_pm_action); \
\
DEVICE_DT_INST_DEFINE(n, &kscan_joystick_init, PM_DEVICE_DT_INST_GET(n), \
&kscan_joystick_data_##n, &kscan_joystick_config_##n, POST_KERNEL, \
CONFIG_KSCAN_INIT_PRIORITY, &kscan_joystick_api);
DT_INST_FOREACH_STATUS_OKAY(KSCAN_JOYSTICK_INIT);