mirror of
https://github.com/torvalds/linux.git
synced 2024-11-16 17:12:06 +00:00
can: mcp251x: avoid write to error flag register if it's unnecessary
Only two bits (RX0OVR and RX1OVR) are writable in EFLG, write is useless if these bits aren't set. Signed-off-by: Ed Spiridonov <edo.rus@gmail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
c1bb0a5588
commit
d694b06c42
@ -843,7 +843,7 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)
|
||||
if (clear_intf)
|
||||
mcp251x_write_bits(spi, CANINTF, clear_intf, 0x00);
|
||||
|
||||
if (eflag)
|
||||
if (eflag & (EFLG_RX0OVR | EFLG_RX1OVR))
|
||||
mcp251x_write_bits(spi, EFLG, eflag, 0x00);
|
||||
|
||||
/* Update can state */
|
||||
|
Loading…
Reference in New Issue
Block a user