diff options
| author | Uwe Kleine-König <[email protected]> | 2015-02-21 10:40:24 +0000 |
|---|---|---|
| committer | Michael Turquette <[email protected]> | 2015-03-09 21:19:54 +0000 |
| commit | 26bac95aa88c2b1747808c0b885abe7814c0165d (patch) | |
| tree | e5b94aca44f42c17cdef858f1c8782a625769c5e /net/switchdev/switchdev.c | |
| parent | clk: divider: fix calculation of maximal parent rate for a given divider (diff) | |
| download | kernel-26bac95aa88c2b1747808c0b885abe7814c0165d.tar.gz kernel-26bac95aa88c2b1747808c0b885abe7814c0165d.zip | |
clk: divider: fix selection of divider when rounding to closest
It's an invalid approach to assume that among two divider values
the one nearer the exact divider is the better one.
Assume a parent rate of 1000 Hz, a divider with CLK_DIVIDER_POWER_OF_TWO
and a target rate of 89 Hz. The exact divider is ~ 11.236 so 8 and 16
are the candidates to choose from yielding rates 125 Hz and 62.5 Hz
respectivly. While 8 is nearer to 11.236 than 16 is, the latter is still
the better divider as 62.5 is nearer to 89 than 125 is.
Fixes: 774b514390b1 (clk: divider: Add round to closest divider)
Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Sascha Hauer <[email protected]>
Acked-by: Maxime Coquelin <[email protected]>
Signed-off-by: Michael Turquette <[email protected]>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions
