Skip to content

Commit

Permalink
drivers: gpio: dw: Switch to DT_INST_IRQN_BY_IDX
Browse files Browse the repository at this point in the history
Switch to using `DT_*IRQN` helpers for obtaining the IRQ number instead of
directly accessing the `irq` cell. This change ensures that the encoded
values for multi-level interrupts are correctly retrieved.

Signed-off-by: Chen Xingyu <[email protected]>
  • Loading branch information
xingrz authored and henrikbrixandersen committed Mar 24, 2024
1 parent 3723493 commit a622407
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpio/gpio_dw.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,10 @@ static int gpio_dw_initialize(const struct device *port)
COND_CODE_1(DT_INST_IRQ_HAS_CELL(n, flags), (DT_INST_IRQ(n, flags)), (0))

#define GPIO_CFG_IRQ(idx, n) \
IRQ_CONNECT(DT_INST_IRQ_BY_IDX(n, idx, irq), \
IRQ_CONNECT(DT_INST_IRQN_BY_IDX(n, idx), \
DT_INST_IRQ(n, priority), gpio_dw_isr, \
DEVICE_DT_INST_GET(n), INST_IRQ_FLAGS(n)); \
irq_enable(DT_INST_IRQ_BY_IDX(n, idx, irq)); \
irq_enable(DT_INST_IRQN_BY_IDX(n, idx)); \

#define GPIO_DW_INIT(n) \
static void gpio_config_##n##_irq(const struct device *port) \
Expand Down

0 comments on commit a622407

Please sign in to comment.