move first *_carrier_off() in front of register_netdev()/ ecdev_open() stable-1.5
authorPatrick Bruenn <p.bruenn@beckhoff.com>
Thu, 05 Jun 2014 16:14:13 +0200
branchstable-1.5
changeset 2568 2f3078ec9ffb
parent 2567 d70aad2f131f
child 2569 720172a7563f
move first *_carrier_off() in front of register_netdev()/ ecdev_open()
devices/ccat/netdev.c
--- a/devices/ccat/netdev.c	Thu Jun 05 16:07:52 2014 +0200
+++ b/devices/ccat/netdev.c	Thu Jun 05 16:14:13 2014 +0200
@@ -320,6 +320,8 @@
 		priv->stop_queue = ecdev_nop;
 		priv->tx_fifo_full = ecdev_tx_fifo_full;
 		priv->unregister = unregister_ecdev;
+
+		priv->carrier_off(netdev);
 		if (ecdev_open(priv->ecdev)) {
 			pr_info("unable to register network device.\n");
 			ecdev_withdraw(priv->ecdev);
@@ -339,6 +341,8 @@
 	priv->stop_queue = netif_stop_queue;
 	priv->tx_fifo_full = ccat_eth_tx_fifo_full;
 	priv->unregister = unregister_netdev;
+
+	priv->carrier_off(netdev);
 	if (register_netdev(netdev)) {
 		pr_info("unable to register network device.\n");
 		ccat_eth_priv_free_dma(priv);
@@ -361,7 +365,6 @@
 {
 	struct ccat_eth_priv *const priv = netdev_priv(dev);
 
-	priv->carrier_off(dev);
 	hrtimer_init(&priv->poll_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 	priv->poll_timer.function = poll_timer_callback;
 	hrtimer_start(&priv->poll_timer, ktime_set(0, 100000),