Skip to content

Commit

Permalink
drivers/net: Call netif_carrier_off at the end of the probe
Browse files Browse the repository at this point in the history
Without calling of netif_carrier_off at the end of the probe the operstate
is unknown when the device is initially opened. By default the carrier is
on so when the device is opened and netif_carrier_on is called the link
watch event is not fired and operstate remains zero (unknown).

This patch fixes this behavior in forcedeth and r8169.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ivan Vecera authored and David S. Miller committed Feb 17, 2011
1 parent c600636 commit 0d672e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -5645,6 +5645,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
goto out_error;
}

netif_carrier_off(dev);

dev_info(&pci_dev->dev, "ifname %s, PHY OUI 0x%x @ %d, addr %pM\n",
dev->name, np->phy_oui, np->phyaddr, dev->dev_addr);

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -3190,6 +3190,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (pci_dev_run_wake(pdev))
pm_runtime_put_noidle(&pdev->dev);

netif_carrier_off(dev);

out:
return rc;

Expand Down

0 comments on commit 0d672e9

Please sign in to comment.