diff options
author | Michal Simek <michal.simek@xilinx.com> | 2016-05-18 12:46:12 +0200 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2016-05-24 13:17:59 +0200 |
commit | b733c278d7adc48c71bd06faf359db3d9e385185 (patch) | |
tree | ffac509445c1f6964c49fac2bad7773825a73f13 /drivers/net/phy/realtek.c | |
parent | ef5e821bd89aa059a20841e041221dadbf60aa7d (diff) |
net: phy: Handle phy_startup() error codes properly
Propagate error code from genphy_update_link() to phy startup().
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'drivers/net/phy/realtek.c')
-rw-r--r-- | drivers/net/phy/realtek.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index 9d7f55bdae..7a99cb0234 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -208,28 +208,38 @@ static int rtl8211f_parse_status(struct phy_device *phydev) static int rtl8211x_startup(struct phy_device *phydev) { + int ret; + /* Read the Status (2x to make sure link is right) */ - genphy_update_link(phydev); - rtl8211x_parse_status(phydev); + ret = genphy_update_link(phydev); + if (ret) + return ret; - return 0; + return rtl8211x_parse_status(phydev); } static int rtl8211e_startup(struct phy_device *phydev) { - genphy_update_link(phydev); - genphy_parse_link(phydev); + int ret; - return 0; + ret = genphy_update_link(phydev); + if (ret) + return ret; + + return genphy_parse_link(phydev); } static int rtl8211f_startup(struct phy_device *phydev) { + int ret; + + /* Read the Status (2x to make sure link is right) */ + ret = genphy_update_link(phydev); + if (ret) + return ret; /* Read the Status (2x to make sure link is right) */ - genphy_update_link(phydev); - rtl8211f_parse_status(phydev); - return 0; + return rtl8211f_parse_status(phydev); } /* Support for RTL8211B PHY */ |