drivers: can: nuvoton: numaker: use named IRQs

Switch to using named IRQs as index-based access makes no guarantees about
devicetree interrupt order.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2024-01-08 14:19:58 +01:00 committed by Carles Cufí
parent b1cf5f0ffc
commit e24a3f5975
2 changed files with 9 additions and 6 deletions

View file

@ -249,18 +249,18 @@ static const struct can_mcan_ops can_numaker_ops = {
\
static void can_numaker_irq_config_func_##inst(const struct device *dev) \
{ \
IRQ_CONNECT(DT_INST_IRQ_BY_IDX(inst, 0, irq), \
DT_INST_IRQ_BY_IDX(inst, 0, priority), \
IRQ_CONNECT(DT_INST_IRQ_BY_NAME(inst, int0, irq), \
DT_INST_IRQ_BY_NAME(inst, int0, priority), \
can_mcan_line_0_isr, \
DEVICE_DT_INST_GET(inst), \
0); \
irq_enable(DT_INST_IRQ_BY_IDX(inst, 0, irq)); \
IRQ_CONNECT(DT_INST_IRQ_BY_IDX(inst, 1, irq), \
DT_INST_IRQ_BY_IDX(inst, 1, priority), \
irq_enable(DT_INST_IRQ_BY_NAME(inst, int0, irq)); \
IRQ_CONNECT(DT_INST_IRQ_BY_NAME(inst, int1, irq), \
DT_INST_IRQ_BY_NAME(inst, int1, priority), \
can_mcan_line_1_isr, \
DEVICE_DT_INST_GET(inst), \
0); \
irq_enable(DT_INST_IRQ_BY_IDX(inst, 1, irq)); \
irq_enable(DT_INST_IRQ_BY_NAME(inst, int1, irq)); \
} \
\
static const struct can_numaker_config can_numaker_config_##inst = { \

View file

@ -14,6 +14,9 @@ properties:
interrupts:
required: true
interrupt-names:
required: true
resets:
required: true