can: peak_usb: report bus recovery as well
authorJeroen Hofstee <jhofstee@victronenergy.com>
Wed, 25 Sep 2019 08:58:45 +0000 (08:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:34:09 +0000 (15:34 +0100)
commit7a3167c879914e34a278599b3b66e55d94d2caf2
tree4bcf71e1e2ec8652eecfd5e76e0534a3d8a26dbd
parentd4b5739a6a6eeb7ca92bd038e6d4ca2c8ea6d3a2
can: peak_usb: report bus recovery as well

[ Upstream commit 128a1b87d3ceb2ba449d5aadb222fe22395adeb0 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/usb/peak_usb/pcan_usb.c