diff --git a/drivers/interrupt_controller/intc_rv32m1_intmux.c b/drivers/interrupt_controller/intc_rv32m1_intmux.c index a9ba89e671a..7327a1eda36 100644 --- a/drivers/interrupt_controller/intc_rv32m1_intmux.c +++ b/drivers/interrupt_controller/intc_rv32m1_intmux.c @@ -45,10 +45,7 @@ struct rv32m1_intmux_config { struct _isr_table_entry *isr_base; }; -#define DEV_CFG(dev) \ - ((struct rv32m1_intmux_config *)(dev->config)) - -#define DEV_REGS(dev) (DEV_CFG(dev)->regs) +#define DEV_REGS(dev) (((const struct rv32m1_intmux_config *)(dev->config))->regs) /* * API @@ -110,10 +107,11 @@ static int rv32m1_intmux_get_line_state(const struct device *dev, static void rv32m1_intmux_isr(const void *arg) { const struct device *dev = DEVICE_DT_INST_GET(0); + const struct rv32m1_intmux_config *config = dev->config; INTMUX_Type *regs = DEV_REGS(dev); uint32_t channel = POINTER_TO_UINT(arg); uint32_t line = (regs->CHANNEL[channel].CHn_VEC >> 2); - struct _isr_table_entry *isr_base = DEV_CFG(dev)->isr_base; + struct _isr_table_entry *isr_base = config->isr_base; struct _isr_table_entry *entry; /* @@ -152,7 +150,7 @@ static const struct rv32m1_intmux_config rv32m1_intmux_cfg = { static int rv32m1_intmux_init(const struct device *dev) { - const struct rv32m1_intmux_config *config = DEV_CFG(dev); + const struct rv32m1_intmux_config *config = dev->config; INTMUX_Type *regs = DEV_REGS(dev); size_t i; diff --git a/drivers/interrupt_controller/intc_sam0_eic.c b/drivers/interrupt_controller/intc_sam0_eic.c index 946838a4dbb..ab1af180fbd 100644 --- a/drivers/interrupt_controller/intc_sam0_eic.c +++ b/drivers/interrupt_controller/intc_sam0_eic.c @@ -27,9 +27,6 @@ struct sam0_eic_data { struct sam0_eic_line_assignment lines[EIC_EXTINT_NUM]; }; -#define DEV_DATA(dev) \ - ((struct sam0_eic_data *const)(dev)->data) - static void wait_synchronization(void) { #ifdef REG_EIC_SYNCBUSY @@ -52,7 +49,7 @@ static inline void set_eic_enable(bool on) static void sam0_eic_isr(const struct device *dev) { - struct sam0_eic_data *const dev_data = DEV_DATA(dev); + struct sam0_eic_data *const dev_data = dev->data; uint16_t bits = EIC->INTFLAG.reg; uint32_t line_index;