Skip to content

Commit c638456

Browse files
Rasmus Villemoesmarckleinebudde
authored andcommitted
can: dev: call netif_carrier_off() in register_candev()
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 <[email protected]> Acked-by: Willem de Bruijn <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent d86afb8 commit c638456

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/can/dev.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,8 @@ int register_candev(struct net_device *dev)
12491249
return -EINVAL;
12501250

12511251
dev->rtnl_link_ops = &can_link_ops;
1252+
netif_carrier_off(dev);
1253+
12521254
return register_netdev(dev);
12531255
}
12541256
EXPORT_SYMBOL_GPL(register_candev);

0 commit comments

Comments
 (0)