b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 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 |
| 6 | |
| 7 | In the previous patch the function flexcan_write64() was introduced. |
| 8 | |
| 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(). |
| 11 | |
| 12 | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> |
| 13 | --- |
| 14 | drivers/net/can/flexcan.c | 11 +++-------- |
| 15 | 1 file changed, 3 insertions(+), 8 deletions(-) |
| 16 | |
| 17 | --- a/drivers/net/can/flexcan.c |
| 18 | +++ b/drivers/net/can/flexcan.c |
| 19 | @@ -891,15 +891,10 @@ static struct sk_buff *flexcan_mailbox_r |
| 20 | } |
| 21 | |
| 22 | mark_as_read: |
| 23 | - if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) { |
| 24 | - /* Clear IRQ */ |
| 25 | - if (n < 32) |
| 26 | - priv->write(BIT(n), ®s->iflag1); |
| 27 | - else |
| 28 | - priv->write(BIT(n - 32), ®s->iflag2); |
| 29 | - } else { |
| 30 | + if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) |
| 31 | + flexcan_write64(priv, FLEXCAN_IFLAG_MB(n), ®s->iflag1); |
| 32 | + else |
| 33 | priv->write(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, ®s->iflag1); |
| 34 | - } |
| 35 | |
| 36 | /* Read the Free Running Timer. It is optional but recommended |
| 37 | * to unlock Mailbox as soon as possible and make it available |