Commit 9fafe7dab9bc8a9e33e1ba5e28a3ec870d689b82

Authored by Troy Kisky
Committed by Albert ARIBAUD
1 parent 8682aba7da
Exists in master and in 55 other branches 8qm-imx_v2020.04_5.4.70_2.3.0, emb_lf_v2022.04, emb_lf_v2023.04, imx_v2015.04_4.1.15_1.0.0_ga, pitx_8mp_lf_v2020.04, smarc-8m-android-10.0.0_2.6.0, smarc-8m-android-11.0.0_2.0.0, smarc-8mp-android-11.0.0_2.0.0, smarc-emmc-imx_v2014.04_3.10.53_1.1.0_ga, smarc-emmc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx-l5.0.0_1.0.0-ga, smarc-imx6_v2018.03_4.14.98_2.0.0_ga, smarc-imx7_v2017.03_4.9.11_1.0.0_ga, smarc-imx7_v2018.03_4.14.98_2.0.0_ga, smarc-imx_v2014.04_3.14.28_1.0.0_ga, smarc-imx_v2015.04_4.1.15_1.0.0_ga, smarc-imx_v2017.03_4.9.11_1.0.0_ga, smarc-imx_v2017.03_4.9.88_2.0.0_ga, smarc-imx_v2017.03_o8.1.0_1.3.0_8m, smarc-imx_v2018.03_4.14.78_1.0.0_ga, smarc-m6.0.1_2.1.0-ga, smarc-n7.1.2_2.0.0-ga, smarc-rel_imx_4.1.15_2.0.0_ga, smarc_8m-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8m-imx_v2019.04_4.19.35_1.1.0, smarc_8m_00d0-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2018.03_4.14.98_2.0.0_ga, smarc_8mm-imx_v2019.04_4.19.35_1.1.0, smarc_8mm-imx_v2020.04_5.4.24_2.1.0, smarc_8mp_lf_v2020.04, smarc_8mq-imx_v2020.04_5.4.24_2.1.0, smarc_8mq_lf_v2020.04, ti-u-boot-2015.07, u-boot-2013.01.y, v2013.10, v2013.10-smarct33, v2013.10-smartmen, v2014.01, v2014.04, v2014.04-smarct33, v2014.04-smarct33-emmc, v2014.04-smartmen, v2014.07, v2014.07-smarct33, v2014.07-smartmen, v2015.07-smarct33, v2015.07-smarct33-emmc, v2015.07-smarct4x, v2016.05-dlt, v2016.05-smarct3x, v2016.05-smarct3x-emmc, v2016.05-smarct4x, v2017.01-smarct3x, v2017.01-smarct3x-emmc, v2017.01-smarct4x

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