Commit 9fafe7dab9bc8a9e33e1ba5e28a3ec870d689b82

Authored by Troy Kisky
Committed by Albert ARIBAUD
1 parent 8682aba7da

net: phy: make board_phy_config responsible for calling drv->config

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>

Showing 3 changed files with 6 additions and 3 deletions Side-by-side Diff

board/freescale/corenet_ds/eth_p4080.c
... ... @@ -96,6 +96,8 @@
96 96 #if defined(CONFIG_SYS_P4080_ERRATUM_SERDES9) && defined(CONFIG_PHY_TERANETICS)
97 97 int board_phy_config(struct phy_device *phydev)
98 98 {
  99 + if (phydev->drv->config)
  100 + phydev->drv->config(phydev);
99 101 if (phydev->drv->uid == PHY_UID_TN2020) {
100 102 unsigned long timeout = 1 * 1000; /* 1 seconds */
101 103 enum srds_prtcl device;
board/freescale/mpc8544ds/mpc8544ds.c
... ... @@ -261,6 +261,8 @@
261 261 uint phyid;
262 262 struct mii_dev *bus = phydev->bus;
263 263  
  264 + if (phydev->drv->config)
  265 + phydev->drv->config(phydev);
264 266 if (do_once)
265 267 return 0;
266 268  
drivers/net/phy/phy.c
... ... @@ -733,6 +733,8 @@
733 733  
734 734 static int __board_phy_config(struct phy_device *phydev)
735 735 {
  736 + if (phydev->drv->config)
  737 + return phydev->drv->config(phydev);
736 738 return 0;
737 739 }
738 740  
... ... @@ -741,9 +743,6 @@
741 743  
742 744 int phy_config(struct phy_device *phydev)
743 745 {
744   - if (phydev->drv->config)
745   - phydev->drv->config(phydev);
746   -
747 746 /* Invoke an optional board-specific helper */
748 747 board_phy_config(phydev);
749 748