netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] can: dev: call netif_carrier_off() in register_candev()
@ 2019-06-24  8:34 Rasmus Villemoes
  2019-06-24 17:26 ` Willem de Bruijn
  0 siblings, 1 reply; 7+ messages in thread
From: Rasmus Villemoes @ 2019-06-24  8:34 UTC (permalink / raw)
  To: Wolfgang Grandegger, Marc Kleine-Budde, David S. Miller
  Cc: Rasmus Villemoes, linux-can, netdev, linux-kernel

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>
---
 drivers/net/can/dev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index c05e4d50d43d..fad27ace6248 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -1260,6 +1260,7 @@ 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);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-06-27  1:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24  8:34 [PATCH net-next] can: dev: call netif_carrier_off() in register_candev() Rasmus Villemoes
2019-06-24 17:26 ` Willem de Bruijn
2019-06-26  9:31   ` Rasmus Villemoes
2019-06-26 14:17     ` Willem de Bruijn
2019-06-26 21:19       ` Rasmus Villemoes
2019-06-27  1:56         ` Willem de Bruijn
2019-06-26 16:03     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).