Skip to content

Commit a63e104

Browse files
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 <[email protected]> Closes: https://patch.msgid.link/[email protected] Fixes: ff60bfb ("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 <[email protected]>
1 parent cd0983c commit a63e104

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/net/can/rockchip/rockchip_canfd-core.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,11 +491,9 @@ rkcanfd_handle_error_int_reg_ec(struct rkcanfd_priv *priv, struct can_frame *cf,
491491
else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_CRC)
492492
cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ;
493493
else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_ACK_EOF)
494-
cf->data[3] = CAN_ERR_PROT_LOC_ACK;
494+
cf->data[3] = CAN_ERR_PROT_LOC_ACK_DEL;
495495
else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_ACK)
496496
cf->data[3] = CAN_ERR_PROT_LOC_ACK;
497-
else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_ACK_EOF)
498-
cf->data[3] = CAN_ERR_PROT_LOC_ACK_DEL;
499497
/* RKCANFD_REG_ERROR_CODE_TX_ERROR */
500498
else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_OVERLOAD)
501499
cf->data[2] |= CAN_ERR_PROT_OVERLOAD;

0 commit comments

Comments
 (0)