OSDN Git Service

can: peak_usb: pcan_usb_decode_error(): upgrade handling of bus state changes
authorStephane Grosjean <s.grosjean@peak-system.com>
Thu, 15 Jul 2021 14:28:41 +0000 (16:28 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 25 Jul 2021 09:36:28 +0000 (11:36 +0200)
commitc11dcee758302702a83c6e85e4c4c3d9af42d2b3
treecdc721fdf7577a18d6c2f9bd85bb71115c3b1c71
parent1763c547648d5592b79139a1f5cf2e88d6258cf6
can: peak_usb: pcan_usb_decode_error(): upgrade handling of bus state changes

This patch updates old code by using the can_change_state() function
published since by the socket-can module.

In particular, this new code better manages the change of bus state by
also using the value of the error counters that the driver now
systematically asks for when initializing the channel.

Link: https://lore.kernel.org/r/20210715142842.35793-1-s.grosjean@peak-system.com
Signed-off-by: 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