Skip to content

Commit b9468ad

Browse files
can: flexcan: flexcan_mailbox_read() make use of flexcan_write64() to mark the mailbox as read
In the previous patch the function flexcan_write64() was introduced. This patch replaces the open coded variant in flexcan_mailbox_read() that marks a mailbox as read, by a single call to flexcan_write64(). Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent b87c28b commit b9468ad

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/net/can/flexcan.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -883,15 +883,10 @@ static struct sk_buff *flexcan_mailbox_read(struct can_rx_offload *offload,
883883
}
884884

885885
mark_as_read:
886-
if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) {
887-
/* Clear IRQ */
888-
if (n < 32)
889-
priv->write(BIT(n), &regs->iflag1);
890-
else
891-
priv->write(BIT(n - 32), &regs->iflag2);
892-
} else {
886+
if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP)
887+
flexcan_write64(priv, FLEXCAN_IFLAG_MB(n), &regs->iflag1);
888+
else
893889
priv->write(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, &regs->iflag1);
894-
}
895890

896891
/* Read the Free Running Timer. It is optional but recommended
897892
* to unlock Mailbox as soon as possible and make it available

0 commit comments

Comments
 (0)