can: peak_usb: report bus recovery as well
authorJeroen Hofstee <jhofstee@victronenergy.com>
Wed, 25 Sep 2019 08:58:45 +0000 (08:58 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 4 Nov 2019 20:47:20 +0000 (21:47 +0100)
commit128a1b87d3ceb2ba449d5aadb222fe22395adeb0
treef98a1df86f9b0b69a9b8240d4ab79e0f603add44
parentf7a1337f0d29b98733c8824e165fca3371d7d4fd
can: peak_usb: report bus recovery as well

While the state changes are reported when the error counters increase
and decrease, there is no event when the bus recovers and the error
counters decrease again. So add those as well.

Change the state going downward to be ERROR_PASSIVE -> ERROR_WARNING ->
ERROR_ACTIVE instead of directly to ERROR_ACTIVE again.

Signed-off-by: Jeroen Hofstee <jhofstee@victronenergy.com>
Cc: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/peak_usb/pcan_usb.c