diff options
Diffstat (limited to '')
-rw-r--r-- | drivers/net/can/dev/dev.c (renamed from drivers/net/can/dev.c) | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev/dev.c index 8738d37f7..3797d4de2 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev/dev.c @@ -563,7 +563,8 @@ static void can_restart(struct net_device *dev) struct can_frame *cf; int err; - BUG_ON(netif_carrier_ok(dev)); + if (netif_carrier_ok(dev)) + netdev_err(dev, "Attempt to restart for bus-off recovery, but carrier is OK?\n"); /* * No synchronization needed because the device is bus-off and @@ -589,11 +590,12 @@ restart: priv->can_stats.restarts++; /* Now restart the device */ - err = priv->do_set_mode(dev, CAN_MODE_START); - netif_carrier_on(dev); - if (err) + err = priv->do_set_mode(dev, CAN_MODE_START); + if (err) { netdev_err(dev, "Error %d during restart", err); + netif_carrier_off(dev); + } } static void can_restart_work(struct work_struct *work) |