phy: brcm-sata: fix a timeout test in init
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 19 Jun 2017 10:56:05 +0000 (13:56 +0300)
committerKishon Vijay Abraham I <kishon@ti.com>
Tue, 22 Aug 2017 04:41:27 +0000 (10:11 +0530)
We want to timeout with try set to zero so this should be a pre-op
instead of post-op.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/broadcom/phy-brcm-sata.c

index e6544c8b1ace2da80cf431eb230ab66032a844cb..9d7f74fe3d7cf74759869e0547db8eb1954213a7 100644 (file)
@@ -335,7 +335,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)