can: sja1000: sja1000_err(): fix {rx,tx}_errors statistics
authorDario Binacchi <dario.binacchi@amarulasolutions.com>
Fri, 22 Nov 2024 22:15:50 +0000 (23:15 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 26 Nov 2024 09:50:54 +0000 (10:50 +0100)
commit2c4ef3af4b028a0eaaf378df511d3b425b1df61f
treee19a86a58679279e077066d8e37487e56718f51e
parent3e4645931655776e757f9fb5ae29371cd7cb21a2
can: sja1000: sja1000_err(): fix {rx,tx}_errors statistics

The sja1000_err() function only incremented the receive error counter
and never the transmit error counter, even if the ECC_DIR flag reported
that an error had occurred during transmission.

Increment the receive/transmit error counter based on the value of the
ECC_DIR flag.

Fixes: 429da1cc841b ("can: Driver for the SJA1000 CAN controller")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Link: https://patch.msgid.link/20241122221650.633981-10-dario.binacchi@amarulasolutions.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/sja1000/sja1000.c