mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
arm64: allwinner: clk: Test with the current parent freq first
Even if the clock is flagged with AW_CLK_SET_PARENT the current parent freq might be enough to get a correct divisor. So test first if we can get the expected freq before changing the parent freq.
This commit is contained in:
parent
bec0a5dca7
commit
ac1d7397bf
1 changed files with 3 additions and 4 deletions
|
|
@ -175,7 +175,9 @@ aw_clk_m_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout,
|
|||
|
||||
best = cur = 0;
|
||||
|
||||
if ((sc->flags & AW_CLK_SET_PARENT) != 0) {
|
||||
best = aw_clk_m_find_best(sc, fparent, fout,
|
||||
&best_m);
|
||||
if ((best != *fout) && ((sc->flags & AW_CLK_SET_PARENT) != 0)) {
|
||||
p_clk = clknode_get_parent(clk);
|
||||
if (p_clk == NULL) {
|
||||
printf("%s: Cannot get parent for clock %s\n",
|
||||
|
|
@ -187,9 +189,6 @@ aw_clk_m_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout,
|
|||
clknode_get_freq(p_clk, &fparent);
|
||||
best = aw_clk_m_find_best(sc, fparent, fout,
|
||||
&best_m);
|
||||
} else {
|
||||
best = aw_clk_m_find_best(sc, fparent, fout,
|
||||
&best_m);
|
||||
}
|
||||
|
||||
if ((flags & CLK_SET_DRYRUN) != 0) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue