summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-05-16 13:53:20 -0400
committerDavid S. Miller <davem@davemloft.net>2016-05-16 13:53:20 -0400
commitb0456b24ff4c8f408feaf97ea465897672bb1ac1 (patch)
treefd4a2312fd89e8adcbc4c4ef581dc4993c5c74c1
parent485b777855ed74dfcde5c46cfc88e2bc1b7c0714 (diff)
parentc8396d84c70b47b31b5a9e34732e88bcc7dae9e9 (diff)
downloadlinux-b0456b24ff4c8f408feaf97ea465897672bb1ac1.tar.bz2
Merge branch 'lxt-cleanups'
Sergei Shtylyov says: ==================== Here's the set of 2 patches against DaveM's 'net-next.git' repo. We save several LoCs on the unneeded local variables.... [1/2] lxt: simplify lxt97[01]_config_intr() [2/2] lxt: simplify lxt970_config_init() ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/phy/lxt.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/net/phy/lxt.c b/drivers/net/phy/lxt.c
index f6078376ef50..b9fde1bcf0f0 100644
--- a/drivers/net/phy/lxt.c
+++ b/drivers/net/phy/lxt.c
@@ -80,23 +80,15 @@ static int lxt970_ack_interrupt(struct phy_device *phydev)
static int lxt970_config_intr(struct phy_device *phydev)
{
- int err;
-
if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
- err = phy_write(phydev, MII_LXT970_IER, MII_LXT970_IER_IEN);
+ return phy_write(phydev, MII_LXT970_IER, MII_LXT970_IER_IEN);
else
- err = phy_write(phydev, MII_LXT970_IER, 0);
-
- return err;
+ return phy_write(phydev, MII_LXT970_IER, 0);
}
static int lxt970_config_init(struct phy_device *phydev)
{
- int err;
-
- err = phy_write(phydev, MII_LXT970_CONFIG, 0);
-
- return err;
+ return phy_write(phydev, MII_LXT970_CONFIG, 0);
}
@@ -112,14 +104,10 @@ static int lxt971_ack_interrupt(struct phy_device *phydev)
static int lxt971_config_intr(struct phy_device *phydev)
{
- int err;
-
if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
- err = phy_write(phydev, MII_LXT971_IER, MII_LXT971_IER_IEN);
+ return phy_write(phydev, MII_LXT971_IER, MII_LXT971_IER_IEN);
else
- err = phy_write(phydev, MII_LXT971_IER, 0);
-
- return err;
+ return phy_write(phydev, MII_LXT971_IER, 0);
}
/*