Skip to content

Commit

Permalink
phy: freescale: fsl-samsung-hdmi: Stop searching when exact match is …
Browse files Browse the repository at this point in the history
…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 <aford173@gmail.com>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Link: https://lore.kernel.org/r/20241026132014.73050-2-aford173@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Adam Ford authored and Vinod Koul committed Dec 8, 2024
1 parent 2a9868d commit 1b9b8b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/phy/freescale/phy-fsl-samsung-hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,13 @@ static unsigned long fsl_samsung_hdmi_phy_find_pms(unsigned long fout, u8 *p, u1
min_delta = delta;
best_freq = tmp;
}

/* If we have an exact match, stop looking for a better value */
if (!delta)
goto done;
}
}

done:
if (best_freq) {
*p = best_p;
*m = best_m;
Expand Down

0 comments on commit 1b9b8b1

Please sign in to comment.