]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net:phy:davicom: remove unnecessary code
authorSrinivas Kandagatla <srinivas.kandagatla@st.com>
Mon, 2 Apr 2012 06:25:11 +0000 (06:25 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Apr 2012 23:02:00 +0000 (19:02 -0400)
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>
drivers/net/phy/davicom.c

index 2f774acdb55192f0df5086e6d2a51ef193bf3cfc..5f59cc0647786209916201356d716c3568a1ac14 100644 (file)
@@ -134,12 +134,7 @@ static int dm9161_config_init(struct phy_device *phydev)
                return err;
 
        /* Reconnect the PHY, and enable Autonegotiation */
-       err = phy_write(phydev, MII_BMCR, BMCR_ANENABLE);
-
-       if (err < 0)
-               return err;
-
-       return 0;
+       return phy_write(phydev, MII_BMCR, BMCR_ANENABLE);
 }
 
 static int dm9161_ack_interrupt(struct phy_device *phydev)