drivers: interrupt_controller: drop DEV_DATA/DEV_CFG usage
Stop using redundant DEV_DATA/DEV_CFG macros and use dev->data and dev->config instead. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
72a0d68284
commit
c2078bd3d0
2 changed files with 5 additions and 10 deletions
|
@ -45,10 +45,7 @@ struct rv32m1_intmux_config {
|
||||||
struct _isr_table_entry *isr_base;
|
struct _isr_table_entry *isr_base;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DEV_CFG(dev) \
|
#define DEV_REGS(dev) (((const struct rv32m1_intmux_config *)(dev->config))->regs)
|
||||||
((struct rv32m1_intmux_config *)(dev->config))
|
|
||||||
|
|
||||||
#define DEV_REGS(dev) (DEV_CFG(dev)->regs)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <irq_nextlevel.h> API
|
* <irq_nextlevel.h> API
|
||||||
|
@ -110,10 +107,11 @@ static int rv32m1_intmux_get_line_state(const struct device *dev,
|
||||||
static void rv32m1_intmux_isr(const void *arg)
|
static void rv32m1_intmux_isr(const void *arg)
|
||||||
{
|
{
|
||||||
const struct device *dev = DEVICE_DT_INST_GET(0);
|
const struct device *dev = DEVICE_DT_INST_GET(0);
|
||||||
|
const struct rv32m1_intmux_config *config = dev->config;
|
||||||
INTMUX_Type *regs = DEV_REGS(dev);
|
INTMUX_Type *regs = DEV_REGS(dev);
|
||||||
uint32_t channel = POINTER_TO_UINT(arg);
|
uint32_t channel = POINTER_TO_UINT(arg);
|
||||||
uint32_t line = (regs->CHANNEL[channel].CHn_VEC >> 2);
|
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;
|
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)
|
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);
|
INTMUX_Type *regs = DEV_REGS(dev);
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
|
|
@ -27,9 +27,6 @@ struct sam0_eic_data {
|
||||||
struct sam0_eic_line_assignment lines[EIC_EXTINT_NUM];
|
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)
|
static void wait_synchronization(void)
|
||||||
{
|
{
|
||||||
#ifdef REG_EIC_SYNCBUSY
|
#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)
|
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;
|
uint16_t bits = EIC->INTFLAG.reg;
|
||||||
uint32_t line_index;
|
uint32_t line_index;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue