diff options
Diffstat (limited to 'drivers/net/ethoc.c')
-rw-r--r-- | drivers/net/ethoc.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index afeb9938ff85..1ee9947924d8 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c | |||
@@ -635,21 +635,13 @@ static int ethoc_mdio_probe(struct net_device *dev) | |||
635 | { | 635 | { |
636 | struct ethoc *priv = netdev_priv(dev); | 636 | struct ethoc *priv = netdev_priv(dev); |
637 | struct phy_device *phy; | 637 | struct phy_device *phy; |
638 | int err; | ||
638 | int i; | 639 | int i; |
639 | 640 | ||
640 | for (i = 0; i < PHY_MAX_ADDR; i++) { | 641 | if (priv->phy_id != -1) { |
641 | phy = priv->mdio->phy_map[i]; | 642 | phy = priv->mdio->phy_map[priv->phy_id]; |
642 | if (phy) { | 643 | } else { |
643 | if (priv->phy_id != -1) { | 644 | phy = phy_find_first(priv->mdio); |
644 | /* attach to specified PHY */ | ||
645 | if (priv->phy_id == phy->addr) | ||
646 | break; | ||
647 | } else { | ||
648 | /* autoselect PHY if none was specified */ | ||
649 | if (phy->addr != 0) | ||
650 | break; | ||
651 | } | ||
652 | } | ||
653 | } | 645 | } |
654 | 646 | ||
655 | if (!phy) { | 647 | if (!phy) { |
@@ -657,11 +649,11 @@ static int ethoc_mdio_probe(struct net_device *dev) | |||
657 | return -ENXIO; | 649 | return -ENXIO; |
658 | } | 650 | } |
659 | 651 | ||
660 | phy = phy_connect(dev, dev_name(&phy->dev), ethoc_mdio_poll, 0, | 652 | err = phy_connect_direct(dev, phy, ethoc_mdio_poll, 0, |
661 | PHY_INTERFACE_MODE_GMII); | 653 | PHY_INTERFACE_MODE_GMII); |
662 | if (IS_ERR(phy)) { | 654 | if (err) { |
663 | dev_err(&dev->dev, "could not attach to PHY\n"); | 655 | dev_err(&dev->dev, "could not attach to PHY\n"); |
664 | return PTR_ERR(phy); | 656 | return err; |
665 | } | 657 | } |
666 | 658 | ||
667 | priv->phy = phy; | 659 | priv->phy = phy; |