OSDN Git Service

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:26:36 +0000 (15:26 +0100)
commitef6546a20076aa873dd7fc925be01199b9b0eb1e
tree032368f1ddc889aec5ad8d8b796cf2678e63e47b
parenta389194e8ec6111ad2c4ef286019e574ae5cf78b
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