File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -90,28 +90,30 @@ static int uart_bflb_err_check(const struct device *dev)
90
90
{
91
91
const struct bflb_config * const cfg = dev -> config ;
92
92
uint32_t status = BL_RD_REG (cfg -> reg , UART_INT_STS );
93
- uint32_t tmp = BL_RD_REG ( cfg -> reg , UART_INT_CLEAR ) ;
93
+ uint32_t clear_mask = 0 ;
94
94
int errors = 0 ;
95
95
96
96
if (status & BIT (UART_INT_RX_FER )) {
97
- tmp |= BIT (UART_INT_RX_FER );
97
+ clear_mask |= BIT (UART_INT_RX_FER );
98
98
99
99
errors |= UART_ERROR_OVERRUN ;
100
100
}
101
101
102
102
if (status & BIT (UART_INT_TX_FER )) {
103
- tmp |= BIT (UART_INT_TX_FER );
103
+ clear_mask |= BIT (UART_INT_TX_FER );
104
104
105
105
errors |= UART_ERROR_OVERRUN ;
106
106
}
107
107
108
108
if (status & BIT (UART_INT_PCE )) {
109
- tmp |= BIT (UART_INT_PCE );
109
+ clear_mask |= BIT (UART_INT_PCE );
110
110
111
111
errors |= UART_ERROR_PARITY ;
112
112
}
113
113
114
- BL_WR_REG (cfg -> reg , UART_INT_CLEAR , tmp );
114
+ if (clear_mask != 0 ) {
115
+ BL_WR_REG (cfg -> reg , UART_INT_CLEAR , clear_mask );
116
+ }
115
117
116
118
return errors ;
117
119
}
You can’t perform that action at this time.
0 commit comments