mirror of
https://github.com/torvalds/linux
synced 2024-09-21 11:38:48 +00:00
Merge tag 'drm-misc-fixes-2018-01-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
Final 4.15 drm-misc pull: Just 3 sun4i patches to fix clock computation/checks. * tag 'drm-misc-fixes-2018-01-17' of git://anongit.freedesktop.org/drm/drm-misc: drm/sun4i: hdmi: Add missing rate halving check in sun4i_tmds_determine_rate drm/sun4i: hdmi: Fix incorrect assignment in sun4i_tmds_determine_rate drm/sun4i: hdmi: Check for unset best_parent in sun4i_tmds_determine_rate
This commit is contained in:
commit
75f195f46f
|
@ -102,10 +102,13 @@ static int sun4i_tmds_determine_rate(struct clk_hw *hw,
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (abs(rate - rounded / i) <
|
||||
abs(rate - best_parent / best_div)) {
|
||||
if (!best_parent ||
|
||||
abs(rate - rounded / i / j) <
|
||||
abs(rate - best_parent / best_half /
|
||||
best_div)) {
|
||||
best_parent = rounded;
|
||||
best_div = i;
|
||||
best_half = i;
|
||||
best_div = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue