summaryrefslogtreecommitdiff
path: root/drivers/net/can/c_can/c_can.c
diff options
context:
space:
mode:
authorAndri Yngvason <andri.yngvason@marel.com>2015-01-16 17:30:28 +0300
committerMarc Kleine-Budde <mkl@pengutronix.de>2015-01-20 15:56:53 +0300
commitbe38a6f9f4093b0f1fa9e7d8cb47d588bc117c21 (patch)
tree41a834156d6483c55fa28eccfc208449bff67d95 /drivers/net/can/c_can/c_can.c
parent0c49087462e8587c12ecfeaf1dd46fdc0ddc4532 (diff)
downloadlinux-be38a6f9f4093b0f1fa9e7d8cb47d588bc117c21.tar.xz
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>
Diffstat (limited to 'drivers/net/can/c_can/c_can.c')
-rw-r--r--drivers/net/can/c_can/c_can.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index f94a9fa60488..70f77e96d409 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -866,7 +866,7 @@ static int c_can_handle_state_change(struct net_device *dev,
case C_CAN_BUS_OFF:
/* bus-off state */
priv->can.state = CAN_STATE_BUS_OFF;
- can_bus_off(dev);
+ priv->can.can_stats.bus_off++;
break;
default:
break;