提交 d694b06c 编写于 作者: E Ed Spiridonov 提交者: Marc Kleine-Budde

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: NEd Spiridonov <edo.rus@gmail.com>
Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
上级 c1bb0a55
...@@ -843,7 +843,7 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id) ...@@ -843,7 +843,7 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)
if (clear_intf) if (clear_intf)
mcp251x_write_bits(spi, CANINTF, clear_intf, 0x00); mcp251x_write_bits(spi, CANINTF, clear_intf, 0x00);
if (eflag) if (eflag & (EFLG_RX0OVR | EFLG_RX1OVR))
mcp251x_write_bits(spi, EFLG, eflag, 0x00); mcp251x_write_bits(spi, EFLG, eflag, 0x00);
/* Update can state */ /* Update can state */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册