To me this seems as you need to pass redundant information to uart_disable_flag...
Why not enable this explicitly (analogous to the checking of the flags below) via
```USART_CR1((u32)p->reg_addr) &= ~USART_CR1_IDLEIE``