Skip to content

Commit 1b9b8b1

Browse files
aford173vinodkoul
authored andcommitted
phy: freescale: fsl-samsung-hdmi: Stop searching when exact match is found
There are a series of for-loops which check various values of P and S for the integer divder PLL. The for loops search all entries and use the one closest to the nominal, but it continues to searches through all for loops even after the nominal is achieved. Ending when the nominal value is found stops wasting time, since it will not find a better value than a deviation of 0 Hz. Signed-off-by: Adam Ford <[email protected]> Reviewed-by: Frieder Schrempf <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 2a9868d commit 1b9b8b1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/phy/freescale/phy-fsl-samsung-hdmi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,13 @@ static unsigned long fsl_samsung_hdmi_phy_find_pms(unsigned long fout, u8 *p, u1
440440
min_delta = delta;
441441
best_freq = tmp;
442442
}
443+
444+
/* If we have an exact match, stop looking for a better value */
445+
if (!delta)
446+
goto done;
443447
}
444448
}
445-
449+
done:
446450
if (best_freq) {
447451
*p = best_p;
448452
*m = best_m;

0 commit comments

Comments
 (0)