can: move can_stats.bus_off++ from can_bus_off into can_change_state
In order to be able to move the stats increment from can_bus_off() into can_change_state(), the increment had to be moved back into code that was using can_bus_off() but not can_change_state(). As a side-effect, this patch fixes the following bugs: * Redundant call to can_bus_off() in c_can. * Bus-off counted twice in xilinx_can. Signed-off-by: Andri Yngvason <andri.yngvason@marel.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:

committed by
Marc Kleine-Budde

parent
0c49087462
commit
be38a6f9f4
@@ -488,6 +488,7 @@ static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n,
|
||||
switch (new_state) {
|
||||
case CAN_STATE_BUS_OFF:
|
||||
cf->can_id |= CAN_ERR_BUSOFF;
|
||||
mc->pdev->dev.can.can_stats.bus_off++;
|
||||
can_bus_off(mc->netdev);
|
||||
break;
|
||||
|
||||
|
@@ -634,6 +634,7 @@ static int pcan_usb_pro_handle_error(struct pcan_usb_pro_interface *usb_if,
|
||||
switch (new_state) {
|
||||
case CAN_STATE_BUS_OFF:
|
||||
can_frame->can_id |= CAN_ERR_BUSOFF;
|
||||
dev->can.can_stats.bus_off++;
|
||||
can_bus_off(netdev);
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user