Skip to content

Commit

Permalink
net: phy: mdio-bcm-unimac: remove redundant !timeout check
Browse files Browse the repository at this point in the history
The check for zero timeout is always true at the end of the proceeding
while loop; the only other exit path in the loop is if the unimac MDIO
is not busy.  Remove the redundant zero timeout check and always
return -ETIMEDOUT on this timeout return path.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Colin Ian King authored and David S. Miller committed Mar 27, 2019
1 parent 4f66154 commit 180a8c3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/net/phy/mdio-bcm-unimac.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ static int unimac_mdio_poll(void *wait_func_data)
usleep_range(1000, 2000);
} while (--timeout);

if (!timeout)
return -ETIMEDOUT;

return 0;
return -ETIMEDOUT;
}

static int unimac_mdio_read(struct mii_bus *bus, int phy_id, int reg)
Expand Down

0 comments on commit 180a8c3

Please sign in to comment.