Commit 903c973c authored by Martin Jeřábek's avatar Martin Jeřábek Committed by Martin Jeřábek

driver: pass reg-unions by value

parent d46ab534
......@@ -200,25 +200,25 @@ void ctu_can_fd_abort_tx(void *base)
static void ctu_can_fd_int_conf(void *base, enum ctu_can_fd_regs sreg,
enum ctu_can_fd_regs creg,
const union ctu_can_fd_int_stat *mask,
const union ctu_can_fd_int_stat *val)
union ctu_can_fd_int_stat mask,
union ctu_can_fd_int_stat val)
{
//union ctu_can_fd_int_stat reg;
//reg.u32 = ctu_can_fd_read32(base, sreg);
ctu_can_fd_write32(base, sreg, mask->u32 & val->u32);
ctu_can_fd_write32(base, creg, mask->u32 & (~val->u32));
ctu_can_fd_write32(base, sreg, mask.u32 & val.u32);
ctu_can_fd_write32(base, creg, mask.u32 & (~val.u32));
}
void ctu_can_fd_int_ena(void *base, const union ctu_can_fd_int_stat *mask,
const union ctu_can_fd_int_stat *val)
void ctu_can_fd_int_ena(void *base, union ctu_can_fd_int_stat mask,
union ctu_can_fd_int_stat val)
{
ctu_can_fd_int_conf(base, CTU_CAN_FD_INT_ENA_SET, CTU_CAN_FD_INT_ENA_CLR,
mask, val);
}
void ctu_can_fd_int_mask(void *base, const union ctu_can_fd_int_stat *mask,
const union ctu_can_fd_int_stat *val)
void ctu_can_fd_int_mask(void *base, union ctu_can_fd_int_stat mask,
union ctu_can_fd_int_stat val)
{
ctu_can_fd_int_conf(base, CTU_CAN_FD_INT_MASK_SET, CTU_CAN_FD_INT_MASK_CLR,
mask, val);
......@@ -236,7 +236,7 @@ void ctu_can_fd_set_mode(void *base, const struct can_ctrlmode *mode)
union ctu_can_fd_int_stat reg;
reg.u32 = 0;
reg.s.bei = 1;
ctu_can_fd_int_ena(base, &reg, &reg);
ctu_can_fd_int_ena(base, reg, reg);
}
......
......@@ -315,9 +315,9 @@ static inline union ctu_can_fd_int_stat ctu_can_fd_int_sts(const void *base)
* base Pointer to the base address
* mask Mask of interrupts which should be cleared.
*/
static inline void ctu_can_fd_int_clr(void *base, const union ctu_can_fd_int_stat *mask)
static inline void ctu_can_fd_int_clr(void *base, union ctu_can_fd_int_stat mask)
{
ctu_can_fd_write32(base, CTU_CAN_FD_INT_STAT, mask->u32);
ctu_can_fd_write32(base, CTU_CAN_FD_INT_STAT, mask.u32);
}
......@@ -329,8 +329,8 @@ static inline void ctu_can_fd_int_clr(void *base, const union ctu_can_fd_int_sta
* mask Mask of interrupts which should be enabled/disabled.
* val 0 - disable, 1 - enable the interrupt.
*/
void ctu_can_fd_int_ena(void *base, const union ctu_can_fd_int_stat *mask,
const union ctu_can_fd_int_stat *val);
void ctu_can_fd_int_ena(void *base, union ctu_can_fd_int_stat mask,
union ctu_can_fd_int_stat val);
/*
......@@ -341,8 +341,8 @@ void ctu_can_fd_int_ena(void *base, const union ctu_can_fd_int_stat *mask,
* mask Mask of interrupts which should be enabled/disabled.
* val 0 - unmask, 1 - mask the interrupt.
*/
void ctu_can_fd_int_mask(void *base, const union ctu_can_fd_int_stat *mask,
const union ctu_can_fd_int_stat *val);
void ctu_can_fd_int_mask(void *base, union ctu_can_fd_int_stat mask,
union ctu_can_fd_int_stat val);
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment