提交 526edcf5 编写于 作者: L Leigh Brown 提交者: David S. Miller

net: mvmdio: slight optimisation of orion_mdio_write

Make only a single call to mutex_unlock in orion_mdio_write.
Signed-off-by: NLeigh Brown <leigh@solinno.co.uk>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 839f46bb
...@@ -150,10 +150,8 @@ static int orion_mdio_write(struct mii_bus *bus, int mii_id, ...@@ -150,10 +150,8 @@ static int orion_mdio_write(struct mii_bus *bus, int mii_id,
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
ret = orion_mdio_wait_ready(bus); ret = orion_mdio_wait_ready(bus);
if (ret < 0) { if (ret < 0)
mutex_unlock(&dev->lock); goto out;
return ret;
}
writel(((mii_id << MVMDIO_SMI_PHY_ADDR_SHIFT) | writel(((mii_id << MVMDIO_SMI_PHY_ADDR_SHIFT) |
(regnum << MVMDIO_SMI_PHY_REG_SHIFT) | (regnum << MVMDIO_SMI_PHY_REG_SHIFT) |
...@@ -161,9 +159,9 @@ static int orion_mdio_write(struct mii_bus *bus, int mii_id, ...@@ -161,9 +159,9 @@ static int orion_mdio_write(struct mii_bus *bus, int mii_id,
(value << MVMDIO_SMI_DATA_SHIFT)), (value << MVMDIO_SMI_DATA_SHIFT)),
dev->regs); dev->regs);
out:
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
return ret;
return 0;
} }
static int orion_mdio_reset(struct mii_bus *bus) static int orion_mdio_reset(struct mii_bus *bus)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册