]> git.itanic.dy.fi Git - linux-stable/commit
can: at91_can: at91_irq_err_line(): make use of can_state_get_by_berr_counter()
authorMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 1 May 2023 16:14:41 +0000 (18:14 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 5 Oct 2023 19:47:16 +0000 (21:47 +0200)
commit910f179aa0de17bab654291548aec378f74db293
tree3166a7c28491d14122edec0a3f4aaf12eff6d9aa
parentefad777c3e97472fbd6aa4e5db11dcb3ef3eae90
can: at91_can: at91_irq_err_line(): make use of can_state_get_by_berr_counter()

On the sam9263 the SR bits for bus off, error passive, warning limit,
and error active are not latched and reflect the current status of the
controller. On the sam9x5 and newer SoCs these bits are latched.

To simplify the code, use can_state_get_by_berr_counter() to get the
state of the controller regardless of the SoC version.

Link: https://lore.kernel.org/all/20231005-at91_can-rx_offload-v2-22-9987d53600e0@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/at91_can.c