summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/broadcom.c
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2016-05-18 12:46:12 +0200
committerMichal Simek <michal.simek@xilinx.com>2016-05-24 13:17:59 +0200
commitb733c278d7adc48c71bd06faf359db3d9e385185 (patch)
treeffac509445c1f6964c49fac2bad7773825a73f13 /drivers/net/phy/broadcom.c
parentef5e821bd89aa059a20841e041221dadbf60aa7d (diff)
downloadblackbird-obmc-uboot-b733c278d7adc48c71bd06faf359db3d9e385185.tar.gz
blackbird-obmc-uboot-b733c278d7adc48c71bd06faf359db3d9e385185.zip
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/broadcom.c')
-rw-r--r--drivers/net/phy/broadcom.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index 4b2808eff0..9871cc3edd 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -84,11 +84,14 @@ static int bcm54xx_parse_status(struct phy_device *phydev)
static int bcm54xx_startup(struct phy_device *phydev)
{
+ int ret;
+
/* Read the Status (2x to make sure link is right) */
- genphy_update_link(phydev);
- bcm54xx_parse_status(phydev);
+ ret = genphy_update_link(phydev);
+ if (ret)
+ return ret;
- return 0;
+ return bcm54xx_parse_status(phydev);
}
/* Broadcom BCM5482S */
@@ -139,11 +142,14 @@ static int bcm5482_config(struct phy_device *phydev)
static int bcm_cygnus_startup(struct phy_device *phydev)
{
+ int ret;
+
/* Read the Status (2x to make sure link is right) */
- genphy_update_link(phydev);
- genphy_parse_link(phydev);
+ ret = genphy_update_link(phydev);
+ if (ret)
+ return ret;
- return 0;
+ return genphy_parse_link(phydev);
}
static int bcm_cygnus_config(struct phy_device *phydev)
@@ -239,17 +245,21 @@ static u32 bcm5482_parse_serdes_sr(struct phy_device *phydev)
*/
static int bcm5482_startup(struct phy_device *phydev)
{
+ int ret;
+
if (bcm5482_is_serdes(phydev)) {
bcm5482_parse_serdes_sr(phydev);
phydev->port = PORT_FIBRE;
- } else {
- /* Wait for auto-negotiation to complete or fail */
- genphy_update_link(phydev);
- /* Parse BCM54xx copper aux status register */
- bcm54xx_parse_status(phydev);
+ return 0;
}
- return 0;
+ /* Wait for auto-negotiation to complete or fail */
+ ret = genphy_update_link(phydev);
+ if (ret)
+ return ret;
+
+ /* Parse BCM54xx copper aux status register */
+ return bcm54xx_parse_status(phydev);
}
static struct phy_driver BCM5461S_driver = {
OpenPOWER on IntegriCloud