Skip to contentSkip to conversation

phy: ti-pipe3: Simplify ti_pipe3_dpll_wait_lock implementation

PATCH In review Axel Lin 2 participants 2 messages Mar 3, 2015 Generic PHY framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 phy: ti-pipe3: Simplify ti_pipe3_dpll_wait_lock implementation

Code simplification. No functional change.

---
 drivers/phy/phy-ti-pipe3.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/phy/phy-ti-pipe3.c +3 -7
index 95c88f9..ed72b0d 100644
@@ -165,15 +165,11 @@ static int ti_pipe3_dpll_wait_lock(struct ti_pipe3 *phy)
 		cpu_relax();
 		val = ti_pipe3_readl(phy->pll_ctrl_base, PLL_STATUS);
 		if (val & PLL_LOCK)
-			break;
+			return 0;
 	} while (!time_after(jiffies, timeout));
 
-	if (!(val & PLL_LOCK)) {
-		dev_err(phy->dev, "DPLL failed to lock\n");
-		return -EBUSY;
-	}
-
-	return 0;
+	dev_err(phy->dev, "DPLL failed to lock\n");
+	return -EBUSY;
 }
 
 static int ti_pipe3_dpll_program(struct ti_pipe3 *phy)
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Axel Lin

Code simplification. No functional change.

cheers,
-roger

Quoted 28 lines
---
 drivers/phy/phy-ti-pipe3.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/phy/phy-ti-pipe3.c +3 -7
index 95c88f9..ed72b0d 100644
@@ -165,15 +165,11 @@ static int ti_pipe3_dpll_wait_lock(struct ti_pipe3 *phy)
 		cpu_relax();
 		val = ti_pipe3_readl(phy->pll_ctrl_base, PLL_STATUS);
 		if (val & PLL_LOCK)
-			break;
+			return 0;
 	} while (!time_after(jiffies, timeout));
 
-	if (!(val & PLL_LOCK)) {
-		dev_err(phy->dev, "DPLL failed to lock\n");
-		return -EBUSY;
-	}
-
-	return 0;
+	dev_err(phy->dev, "DPLL failed to lock\n");
+	return -EBUSY;
 }
 
 static int ti_pipe3_dpll_program(struct ti_pipe3 *phy)