Skip to content
Permalink
Browse files

drivers: can: mcp2515: Fix interrupt bit tests for empty TX buffers

TX1 and TX2 buffer empty busy flags would have been cleared only for
TX0 empty interrupts and there would have been extra unwarranted
TX callbacks for TX1 and TX2 if the callbacks had previously been used.

Signed-off-by: Nick Ward <nick.ward@setec.com.au>
  • Loading branch information...
nwsetec authored and ioannisg committed Aug 1, 2019
1 parent de7fb74 commit ea366e9aa317785d25ba61b9147b67cdbb4cdd96
Showing with 2 additions and 2 deletions.
  1. +2 −2 drivers/can/can_mcp2515.c
@@ -461,11 +461,11 @@ static void mcp2515_handle_interrupts(struct device *dev)
mcp2515_tx_done(dev, 0);
}

if (canintf & MCP2515_CANINTF_TX0IF) {
if (canintf & MCP2515_CANINTF_TX1IF) {
mcp2515_tx_done(dev, 1);
}

if (canintf & MCP2515_CANINTF_TX0IF) {
if (canintf & MCP2515_CANINTF_TX2IF) {
mcp2515_tx_done(dev, 2);
}

0 comments on commit ea366e9

Please sign in to comment.
You can’t perform that action at this time.