aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell/mvmdio.c
diff options
context:
space:
mode:
authorLeigh Brown <leigh@solinno.co.uk>2013-10-29 09:33:33 +0000
committerDavid S. Miller <davem@davemloft.net>2013-10-29 18:53:36 -0400
commit526edcf56759142c1c250d2d4c55db9f25be644b (patch)
treebaf06ca3c48ef1ba07730032d83278a6a92d45f5 /drivers/net/ethernet/marvell/mvmdio.c
parentnet: mvmdio: orion_mdio_ready: remove manual poll (diff)
downloadlinux-dev-526edcf56759142c1c250d2d4c55db9f25be644b.tar.xz
linux-dev-526edcf56759142c1c250d2d4c55db9f25be644b.zip
net: mvmdio: slight optimisation of orion_mdio_write
Make only a single call to mutex_unlock in orion_mdio_write. Signed-off-by: Leigh Brown <leigh@solinno.co.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/mvmdio.c')
-rw-r--r--drivers/net/ethernet/marvell/mvmdio.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c
index e3898b3c91ad..0cfa0c860bc3 100644
--- a/drivers/net/ethernet/marvell/mvmdio.c
+++ b/drivers/net/ethernet/marvell/mvmdio.c
@@ -150,10 +150,8 @@ static int orion_mdio_write(struct mii_bus *bus, int mii_id,
mutex_lock(&dev->lock);
ret = orion_mdio_wait_ready(bus);
- if (ret < 0) {
- mutex_unlock(&dev->lock);
- return ret;
- }
+ if (ret < 0)
+ goto out;
writel(((mii_id << MVMDIO_SMI_PHY_ADDR_SHIFT) |
(regnum << MVMDIO_SMI_PHY_REG_SHIFT) |
@@ -161,9 +159,9 @@ static int orion_mdio_write(struct mii_bus *bus, int mii_id,
(value << MVMDIO_SMI_DATA_SHIFT)),
dev->regs);
+out:
mutex_unlock(&dev->lock);
-
- return 0;
+ return ret;
}
static int orion_mdio_reset(struct mii_bus *bus)