Skip to content

Commit d382868

Browse files
committed
i2s: cavs: Fix build issues with driver
Move i2s_cavs_irq_connect_##n up so its available later when used. This fixes compile issues with the driver. Signed-off-by: Kumar Gala <[email protected]>
1 parent 35133c8 commit d382868

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

drivers/i2s/i2s_cavs.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,16 @@ static const struct i2s_driver_api i2s_cavs_driver_api = {
808808
};
809809

810810
#define I2S_CAVS_DEVICE_INIT(n) \
811+
static void i2s_cavs_irq_connect_##n(void) \
812+
{ \
813+
IRQ_CONNECT(DT_INST_IRQN(n), \
814+
DT_INST_IRQ(n, priority), \
815+
i2s_cavs_isr, \
816+
DEVICE_DT_INST_GET(n), 0); \
817+
\
818+
irq_enable(DT_INST_IRQN(n)); \
819+
} \
820+
\
811821
static const struct i2s_cavs_config i2s_cavs_config_##n = { \
812822
.regs = (struct i2s_cavs_ssp *) \
813823
DT_INST_REG_ADDR_BY_IDX(n, 0), \
@@ -870,16 +880,6 @@ static const struct i2s_driver_api i2s_cavs_driver_api = {
870880
&i2s_cavs_data_##n, \
871881
&i2s_cavs_config_##n, \
872882
POST_KERNEL, CONFIG_I2S_INIT_PRIORITY, \
873-
&i2s_cavs_driver_api); \
874-
\
875-
static void i2s_cavs_irq_connect_##n(void) \
876-
{ \
877-
IRQ_CONNECT(DT_INST_IRQN(n), \
878-
DT_INST_IRQ(n, priority), \
879-
i2s_cavs_isr, \
880-
DEVICE_DT_INST_GET(n), 0); \
881-
\
882-
irq_enable(DT_INST_IRQN(n)); \
883-
}
883+
&i2s_cavs_driver_api);
884884

885885
DT_INST_FOREACH_STATUS_OKAY(I2S_CAVS_DEVICE_INIT)

0 commit comments

Comments
 (0)