can: mcp251x: avoid write to error flag register if it's unnecessary
PATCH 1/1 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 <[email protected]>
--- drivers/net/can/spi/mcp251x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/spi/mcp251x.c +1 -1
@@ -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 */
Signature · 1 line
2.7.0
Marc Kleine-Budde
maintainerQuoted 3 lines · Ed Spiridonov
Only two bits (RX0OVR and RX1OVR) are writable in EFLG, write is useless if these bits aren't set.
Signed-off-by Ed Spiridonov <[email protected]>
Added to can.
Thanks,
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |