diff options
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/fec.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 967ad01b1925..e730da26d290 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -637,16 +637,15 @@ unlock: | |||
637 | } | 637 | } |
638 | 638 | ||
639 | static int | 639 | static int |
640 | mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_device *)) | 640 | mii_queue_unlocked(struct net_device *dev, int regval, |
641 | void (*func)(uint, struct net_device *)) | ||
641 | { | 642 | { |
642 | struct fec_enet_private *fep; | 643 | struct fec_enet_private *fep; |
643 | unsigned long flags; | ||
644 | mii_list_t *mip; | 644 | mii_list_t *mip; |
645 | int retval; | 645 | int retval; |
646 | 646 | ||
647 | /* Add PHY address to register command */ | 647 | /* Add PHY address to register command */ |
648 | fep = netdev_priv(dev); | 648 | fep = netdev_priv(dev); |
649 | spin_lock_irqsave(&fep->mii_lock, flags); | ||
650 | 649 | ||
651 | regval |= fep->phy_addr << 23; | 650 | regval |= fep->phy_addr << 23; |
652 | retval = 0; | 651 | retval = 0; |
@@ -667,6 +666,19 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi | |||
667 | retval = 1; | 666 | retval = 1; |
668 | } | 667 | } |
669 | 668 | ||
669 | return retval; | ||
670 | } | ||
671 | |||
672 | static int | ||
673 | mii_queue(struct net_device *dev, int regval, | ||
674 | void (*func)(uint, struct net_device *)) | ||
675 | { | ||
676 | struct fec_enet_private *fep; | ||
677 | unsigned long flags; | ||
678 | int retval; | ||
679 | fep = netdev_priv(dev); | ||
680 | spin_lock_irqsave(&fep->mii_lock, flags); | ||
681 | retval = mii_queue_unlocked(dev, regval, func); | ||
670 | spin_unlock_irqrestore(&fep->mii_lock, flags); | 682 | spin_unlock_irqrestore(&fep->mii_lock, flags); |
671 | return retval; | 683 | return retval; |
672 | } | 684 | } |
@@ -1373,11 +1385,11 @@ mii_discover_phy(uint mii_reg, struct net_device *dev) | |||
1373 | 1385 | ||
1374 | /* Got first part of ID, now get remainder */ | 1386 | /* Got first part of ID, now get remainder */ |
1375 | fep->phy_id = phytype << 16; | 1387 | fep->phy_id = phytype << 16; |
1376 | mii_queue(dev, mk_mii_read(MII_REG_PHYIR2), | 1388 | mii_queue_unlocked(dev, mk_mii_read(MII_REG_PHYIR2), |
1377 | mii_discover_phy3); | 1389 | mii_discover_phy3); |
1378 | } else { | 1390 | } else { |
1379 | fep->phy_addr++; | 1391 | fep->phy_addr++; |
1380 | mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), | 1392 | mii_queue_unlocked(dev, mk_mii_read(MII_REG_PHYIR1), |
1381 | mii_discover_phy); | 1393 | mii_discover_phy); |
1382 | } | 1394 | } |
1383 | } else { | 1395 | } else { |