diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2005-08-25 18:30:37 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-26 00:52:11 -0400 |
commit | 3690b6c124fbc7259634f3b80d92a6d9fe51ec79 (patch) | |
tree | 406f56331a1dc94054f08cff65d5bd9b49e28562 /drivers | |
parent | e9985d53e3da3b51d0334d0622c449fda78ae089 (diff) |
[PATCH] sis190: complete the mii probe before registering the netdevice
The userspace must not be able to issue ethtool command and manage the
mii before it is completely initialized. Avoid some pesky "eth%d" messages.
Signed-off-by: Arnaud Patard <apatard@mandriva.com>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/sis190.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index 915ff009c295..bf3440aa6c24 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c | |||
@@ -1271,7 +1271,7 @@ static u16 sis190_default_phy(struct net_device *dev) | |||
1271 | mii_if->phy_id = phy_default->phy_id; | 1271 | mii_if->phy_id = phy_default->phy_id; |
1272 | net_probe(tp, KERN_INFO | 1272 | net_probe(tp, KERN_INFO |
1273 | "%s: Using transceiver at address %d as default.\n", | 1273 | "%s: Using transceiver at address %d as default.\n", |
1274 | dev->name, mii_if->phy_id); | 1274 | pci_name(tp->pci_dev), mii_if->phy_id); |
1275 | } | 1275 | } |
1276 | 1276 | ||
1277 | status = mdio_read(ioaddr, mii_if->phy_id, MII_BMCR); | 1277 | status = mdio_read(ioaddr, mii_if->phy_id, MII_BMCR); |
@@ -1312,8 +1312,8 @@ static void sis190_init_phy(struct net_device *dev, struct sis190_private *tp, | |||
1312 | phy->type = UNKNOWN; | 1312 | phy->type = UNKNOWN; |
1313 | 1313 | ||
1314 | net_probe(tp, KERN_INFO "%s: %s transceiver at address %d.\n", | 1314 | net_probe(tp, KERN_INFO "%s: %s transceiver at address %d.\n", |
1315 | dev->name, (phy->type == UNKNOWN) ? "Unknown PHY" : p->name, | 1315 | pci_name(tp->pci_dev), |
1316 | phy_id); | 1316 | (phy->type == UNKNOWN) ? "Unknown PHY" : p->name, phy_id); |
1317 | } | 1317 | } |
1318 | 1318 | ||
1319 | /** | 1319 | /** |
@@ -1358,7 +1358,7 @@ static int __devinit sis190_mii_probe(struct net_device *dev) | |||
1358 | 1358 | ||
1359 | if (list_empty(&tp->first_phy)) { | 1359 | if (list_empty(&tp->first_phy)) { |
1360 | net_probe(tp, KERN_INFO "%s: No MII transceivers found!\n", | 1360 | net_probe(tp, KERN_INFO "%s: No MII transceivers found!\n", |
1361 | dev->name); | 1361 | pci_name(tp->pci_dev)); |
1362 | rc = -EIO; | 1362 | rc = -EIO; |
1363 | goto out; | 1363 | goto out; |
1364 | } | 1364 | } |
@@ -1780,15 +1780,16 @@ static int __devinit sis190_init_one(struct pci_dev *pdev, | |||
1780 | dev->base_addr = (unsigned long) 0xdead; | 1780 | dev->base_addr = (unsigned long) 0xdead; |
1781 | 1781 | ||
1782 | spin_lock_init(&tp->lock); | 1782 | spin_lock_init(&tp->lock); |
1783 | rc = register_netdev(dev); | 1783 | |
1784 | rc = sis190_mii_probe(dev); | ||
1784 | if (rc < 0) | 1785 | if (rc < 0) |
1785 | goto err_release_board; | 1786 | goto err_release_board; |
1786 | 1787 | ||
1787 | pci_set_drvdata(pdev, dev); | 1788 | rc = register_netdev(dev); |
1788 | |||
1789 | rc = sis190_mii_probe(dev); | ||
1790 | if (rc < 0) | 1789 | if (rc < 0) |
1791 | goto err_unregister_dev; | 1790 | goto err_remove_mii; |
1791 | |||
1792 | pci_set_drvdata(pdev, dev); | ||
1792 | 1793 | ||
1793 | net_probe(tp, KERN_INFO "%s: %s at %p (IRQ: %d), " | 1794 | net_probe(tp, KERN_INFO "%s: %s at %p (IRQ: %d), " |
1794 | "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", | 1795 | "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", |
@@ -1804,8 +1805,8 @@ static int __devinit sis190_init_one(struct pci_dev *pdev, | |||
1804 | out: | 1805 | out: |
1805 | return rc; | 1806 | return rc; |
1806 | 1807 | ||
1807 | err_unregister_dev: | 1808 | err_remove_mii: |
1808 | unregister_netdev(dev); | 1809 | sis190_mii_remove(dev); |
1809 | err_release_board: | 1810 | err_release_board: |
1810 | sis190_release_board(pdev); | 1811 | sis190_release_board(pdev); |
1811 | goto out; | 1812 | goto out; |