]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
can: sja1000: sja1000_err(): use error counter for error state
authorMichael Tretter <m.tretter@pengutronix.de>
Fri, 23 Jan 2026 10:16:27 +0000 (11:16 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 23 Jan 2026 13:37:26 +0000 (14:37 +0100)
commit22ca24978337477969b955b9bfc46d28b59b5bf7
treef829116b420b05419d9b9b841c4330ae433dd941
parenta6c89d75fd33b0df5e4f88ae9458d455f21fc656
can: sja1000: sja1000_err(): use error counter for error state

The CAN controller sends the EPI interrupt whenever it reaches the error
passive status or enters the error active status from the error passive
status.

Instead of keeping track of the controller status in the driver, read the
txerr and rxerr counters and use can_state_get_by_berr_counter() to
determine the state of the CAN controller.

Suggested-by: Achim Baumgartner <abaumgartner@topcon.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Link: https://patch.msgid.link/20260123-sja1000-state-handling-v2-2-687498087dad@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/sja1000/sja1000.c