Skip to contentSkip to conversation

phy: phy-brcm-sata: fix a loop timeout

PATCH New Dan Carpenter 1 participant 1 message Jun 21, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: phy-brcm-sata: fix a loop timeout

Since this loop is a post op then it means we end with "try = -1" but afterward we test for if it's zero. Fix this by changing to a pre-op so we end on zero.

Fixes 024812889ad1 ('phy: Add SATA3 PHY support for Broadcom NSP SoC')
drivers/phy/phy-brcm-sata.c +1 -1
index 18d6626..c86456f 100644
@@ -329,7 +329,7 @@ static int brcm_nsp_sata_init(struct brcm_sata_port *port)
 
 	/* Wait for pll_seq_done bit */
 	try = 50;
-	while (try--) {
+	while (--try) {
 		val = brcm_sata_phy_rd(base, BLOCK0_REG_BANK,
 					BLOCK0_XGXSSTATUS);
 		if (val & BLOCK0_XGXSSTATUS_PLL_LOCK)