1 From 6340760d0671e92b15ff92b7eda41bbdd9702437 Mon Sep 17 00:00:00 2001
2 From: Marc Kleine-Budde <mkl@pengutronix.de>
3 Date: Fri, 1 Mar 2019 16:27:59 +0100
4 Subject: [PATCH] can: flexcan: flexcan_mailbox_read() make use of
5 flexcan_write64() to mark the mailbox as read
7 In the previous patch the function flexcan_write64() was introduced.
9 This patch replaces the open coded variant in flexcan_mailbox_read()
10 that marks a mailbox as read, by a single call to flexcan_write64().
12 Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
14 drivers/net/can/flexcan.c | 11 +++--------
15 1 file changed, 3 insertions(+), 8 deletions(-)
17 --- a/drivers/net/can/flexcan.c
18 +++ b/drivers/net/can/flexcan.c
19 @@ -883,15 +883,10 @@ static struct sk_buff *flexcan_mailbox_r
23 - if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) {
26 - priv->write(BIT(n), ®s->iflag1);
28 - priv->write(BIT(n - 32), ®s->iflag2);
30 + if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP)
31 + flexcan_write64(priv, FLEXCAN_IFLAG_MB(n), ®s->iflag1);
33 priv->write(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->iflag1);
36 /* Read the Free Running Timer. It is optional but recommended
37 * to unlock Mailbox as soon as possible and make it available