summaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2010-02-17 16:17:01 +0100
committerDavid S. Miller <davem@davemloft.net>2010-02-18 02:27:38 +0100
commit9ea4818dd39cc8c6b31c38c9f51d19d5d4ee0be6 (patch)
tree7002135dea5246364c2a17a6f037c050c50b4cb8 /drivers/net/tg3.c
parenttg3: Reduce indent level of tg3_rx_prodring_alloc (diff)
downloadlinux-9ea4818dd39cc8c6b31c38c9f51d19d5d4ee0be6.tar.xz
linux-9ea4818dd39cc8c6b31c38c9f51d19d5d4ee0be6.zip
tg3: Discover phy address once
The phy address will not change after it has been identified. Move the discovery code to a location that only gets executed once. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index c38143b7b600..3a62cc50c210 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -1035,6 +1035,17 @@ static void tg3_mdio_start(struct tg3 *tp)
tw32_f(MAC_MI_MODE, tp->mi_mode);
udelay(80);
+ if ((tp->tg3_flags3 & TG3_FLG3_MDIOBUS_INITED) &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785)
+ tg3_mdio_config_5785(tp);
+}
+
+static int tg3_mdio_init(struct tg3 *tp)
+{
+ int i;
+ u32 reg;
+ struct phy_device *phydev;
+
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
u32 funcnum, is_serdes;
@@ -1054,17 +1065,6 @@ static void tg3_mdio_start(struct tg3 *tp)
} else
tp->phy_addr = TG3_PHY_MII_ADDR;
- if ((tp->tg3_flags3 & TG3_FLG3_MDIOBUS_INITED) &&
- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785)
- tg3_mdio_config_5785(tp);
-}
-
-static int tg3_mdio_init(struct tg3 *tp)
-{
- int i;
- u32 reg;
- struct phy_device *phydev;
-
tg3_mdio_start(tp);
if (!(tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB) ||