Fix zynq_gem driver to handle error from phy_config correctly.

Signed-off-by: Michal Simek <[email protected]>
---

 drivers/net/phy/phy.c  | 4 +---
 drivers/net/zynq_gem.c | 3 +--
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 98986bb6f13f..4b6c09f88ec0 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -879,9 +879,7 @@ __weak int board_phy_config(struct phy_device *phydev)
 int phy_config(struct phy_device *phydev)
 {
        /* Invoke an optional board-specific helper */
-       board_phy_config(phydev);
-
-       return 0;
+       return board_phy_config(phydev);
 }
 
 int phy_shutdown(struct phy_device *phydev)
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 3704ce0dd78a..4d9c296c0ba9 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -352,9 +352,8 @@ static int zynq_phy_init(struct udevice *dev)
        priv->phydev->supported = supported | ADVERTISED_Pause |
                                  ADVERTISED_Asym_Pause;
        priv->phydev->advertising = priv->phydev->supported;
-       phy_config(priv->phydev);
 
-       return 0;
+       return phy_config(priv->phydev);
 }
 
 static int zynq_gem_init(struct udevice *dev)
-- 
1.9.1

_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to