Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 526edcf5 authored by Leigh Brown's avatar Leigh Brown Committed by David S. Miller
Browse files

net: mvmdio: slight optimisation of orion_mdio_write



Make only a single call to mutex_unlock in orion_mdio_write.

Signed-off-by: default avatarLeigh Brown <leigh@solinno.co.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 839f46bb
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -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)