Skip to content

Commit

Permalink
can: dev: call netif_carrier_off() in register_candev()
Browse files Browse the repository at this point in the history
CONFIG_CAN_LEDS is deprecated. When trying to use the generic netdev
trigger as suggested, there's a small inconsistency with the link
property: The LED is on initially, stays on when the device is brought
up, and then turns off (as expected) when the device is brought down.

Make sure the LED always reflects the state of the CAN device.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Rasmus Villemoes authored and Marc Kleine-Budde committed Jul 24, 2019
1 parent d86afb8 commit c638456
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/can/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,8 @@ int register_candev(struct net_device *dev)
return -EINVAL;

dev->rtnl_link_ops = &can_link_ops;
netif_carrier_off(dev);

return register_netdev(dev);
}
EXPORT_SYMBOL_GPL(register_candev);
Expand Down

0 comments on commit c638456

Please sign in to comment.