]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: phy: make board_phy_config responsible for calling drv->config
authorTroy Kisky <troy.kisky@boundarydevices.com>
Tue, 7 Feb 2012 14:08:49 +0000 (14:08 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Mon, 27 Feb 2012 20:19:25 +0000 (21:19 +0100)
Boards may have things they want done before or after normal phy config.
Letting the boards call drv->config allows them more flexibilty.
Boards affected by this change are corenet_ds and mpc8544ds.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Acked-by: Dirk Behme <dirk.behme@de.bosch.com>
board/freescale/corenet_ds/eth_p4080.c
board/freescale/mpc8544ds/mpc8544ds.c
drivers/net/phy/phy.c

index 1f00c14530d401e031f92c23adb2741b80eef2ba..b87b0922acfc9ca7a1dd55a90227c43d8570c6e7 100644 (file)
@@ -96,6 +96,8 @@ struct mii_dev *mii_dev_for_muxval(u32 muxval)
 #if defined(CONFIG_SYS_P4080_ERRATUM_SERDES9) && defined(CONFIG_PHY_TERANETICS)
 int board_phy_config(struct phy_device *phydev)
 {
+       if (phydev->drv->config)
+               phydev->drv->config(phydev);
        if (phydev->drv->uid == PHY_UID_TN2020) {
                unsigned long timeout = 1 * 1000; /* 1 seconds */
                enum srds_prtcl device;
index 6fe8d3963214cf538228f2960545343fae51820b..24a1715b495fd6caa66176904e9314da73a50820 100644 (file)
@@ -261,6 +261,8 @@ int board_phy_config(struct phy_device *phydev)
        uint phyid;
        struct mii_dev *bus = phydev->bus;
 
+       if (phydev->drv->config)
+               phydev->drv->config(phydev);
        if (do_once)
                return 0;
 
index eb551803e5c749dbcdafb1ed2f0f000f620741e4..7d327f766a2cf23bbfd622de4f0b7e4bae8c4226 100644 (file)
@@ -733,6 +733,8 @@ int phy_startup(struct phy_device *phydev)
 
 static int __board_phy_config(struct phy_device *phydev)
 {
+       if (phydev->drv->config)
+               return phydev->drv->config(phydev);
        return 0;
 }
 
@@ -741,9 +743,6 @@ int board_phy_config(struct phy_device *phydev)
 
 int phy_config(struct phy_device *phydev)
 {
-       if (phydev->drv->config)
-               phydev->drv->config(phydev);
-
        /* Invoke an optional board-specific helper */
        board_phy_config(phydev);