Skip to content

Commit

Permalink
net:phy:marvell: remove unnecessary code
Browse files Browse the repository at this point in the history
Compile tested.
remove unnecessary code that matches this coccinelle pattern

	ret = phy_write(x, y , z)
	if (ret < 0)
	       	return ret;
	return 0;

As phy_write returns error code, we dont need to do not need extra check
before returning.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Srinivas Kandagatla authored and David S. Miller committed Apr 3, 2012
1 parent 8bc47ec commit cc90cb3
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions drivers/net/phy/marvell.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,7 @@ static int m88e1111_config_init(struct phy_device *phydev)
if (err < 0)
return err;

err = phy_write(phydev, MII_BMCR, BMCR_RESET);
if (err < 0)
return err;

return 0;
return phy_write(phydev, MII_BMCR, BMCR_RESET);
}

static int m88e1118_config_aneg(struct phy_device *phydev)
Expand Down Expand Up @@ -515,11 +511,7 @@ static int m88e1118_config_init(struct phy_device *phydev)
if (err < 0)
return err;

err = phy_write(phydev, MII_BMCR, BMCR_RESET);
if (err < 0)
return err;

return 0;
return phy_write(phydev, MII_BMCR, BMCR_RESET);
}

static int m88e1149_config_init(struct phy_device *phydev)
Expand All @@ -545,11 +537,7 @@ static int m88e1149_config_init(struct phy_device *phydev)
if (err < 0)
return err;

err = phy_write(phydev, MII_BMCR, BMCR_RESET);
if (err < 0)
return err;

return 0;
return phy_write(phydev, MII_BMCR, BMCR_RESET);
}

static int m88e1145_config_init(struct phy_device *phydev)
Expand Down

0 comments on commit cc90cb3

Please sign in to comment.