summaryrefslogtreecommitdiff
path: root/drivers/net/can
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2024-09-11 10:09:48 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2024-09-11 10:58:18 +0200
commita63e10462af67257b99b5330b32d1a47583803e2 (patch)
treeefb16b8735043855d1ff2c99d297c8ee0df7fa61 /drivers/net/can
parentcd0983c7f8809d685bc57eda1f11cc1cdb67b9ac (diff)
can: rockchip_canfd: rkcanfd_handle_error_int_reg_ec(): fix decoding of error code register
Probably due to a copy/paste error rkcanfd_handle_error_int_reg_ec() checks twice if the RKCANFD_REG_ERROR_CODE_TX_ACK_EOF bit is set in reg_ec. Keep the correct check for RKCANFD_REG_ERROR_CODE_TX_ACK_EOF and remove the superfluous one. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://patch.msgid.link/9a46d10d-e4e3-40a5-8fb6-f4637959f124@stanley.mountain Fixes: ff60bfbaf67f ("can: rockchip_canfd: add driver for Rockchip CAN-FD controller") Link: https://patch.msgid.link/20240911-can-rockchip_canfd-fixes-v1-2-5ce385b5ab10@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/rockchip/rockchip_canfd-core.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/can/rockchip/rockchip_canfd-core.c b/drivers/net/can/rockchip/rockchip_canfd-core.c
index 6883153e8fc1..df18c85fc078 100644
--- a/drivers/net/can/rockchip/rockchip_canfd-core.c
+++ b/drivers/net/can/rockchip/rockchip_canfd-core.c
@@ -491,11 +491,9 @@ rkcanfd_handle_error_int_reg_ec(struct rkcanfd_priv *priv, struct can_frame *cf,
else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_CRC)
cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ;
else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_ACK_EOF)
- cf->data[3] = CAN_ERR_PROT_LOC_ACK;
+ cf->data[3] = CAN_ERR_PROT_LOC_ACK_DEL;
else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_ACK)
cf->data[3] = CAN_ERR_PROT_LOC_ACK;
- else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_ACK_EOF)
- cf->data[3] = CAN_ERR_PROT_LOC_ACK_DEL;
/* RKCANFD_REG_ERROR_CODE_TX_ERROR */
else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_OVERLOAD)
cf->data[2] |= CAN_ERR_PROT_OVERLOAD;