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

Commit 0f02b4f7 authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller
Browse files

dsa: mv88e6xxx: Use mv88e6xx_wait in mv88e6xxx_update()



Now that mv88e6xx_wait() iterated on a counter than a fixed time
interval, it implements the same mechanism as mv88e6xxx_update() uses.
So use it in mv88e6xx_wait().

Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6441e669
Loading
Loading
Loading
Loading
+4 −12
Original line number Diff line number Diff line
@@ -333,21 +333,13 @@ static int mv88e6xxx_update(struct mv88e6xxx_chip *chip, int addr, int reg,
			    u16 update)
{
	u16 val;
	int i, err;
	int err;

	/* Wait until the previous operation is completed */
	for (i = 0; i < 16; ++i) {
		err = mv88e6xxx_read(chip, addr, reg, &val);
	err = mv88e6xxx_wait(chip, addr, reg, BIT(15));
	if (err)
		return err;

		if (!(val & BIT(15)))
			break;
	}

	if (i == 16)
		return -ETIMEDOUT;

	/* Set the Update bit to trigger a write operation */
	val = BIT(15) | update;