diff options
| author | Uwe Kleine-König <[email protected]> | 2015-02-21 10:40:25 +0000 |
|---|---|---|
| committer | Michael Turquette <[email protected]> | 2015-03-09 21:20:17 +0000 |
| commit | 9315514252a95bca37be3ef8a93f835ed91c2855 (patch) | |
| tree | a417b7e7a6bb53985e43927518ae2e108ee01f95 /net/switchdev/switchdev.c | |
| parent | clk: divider: fix selection of divider when rounding to closest (diff) | |
| download | kernel-9315514252a95bca37be3ef8a93f835ed91c2855.tar.gz kernel-9315514252a95bca37be3ef8a93f835ed91c2855.zip | |
clk: divider: fix calculation of initial best divider when rounding to closest
Similar to the reasoning for the previous commit
DIV_ROUND_CLOSEST(parent_rate, rate)
might not be the best integer divisor to get a good approximation for
rate from parent_rate (given the metric for CLK_DIVIDER_ROUND_CLOSEST).
For example assume a parent rate of 1000 Hz and a target rate of 700.
Using DIV_ROUND_CLOSEST the suggested divisor gets calculated to 1
resulting in a target rate of 1000 with a delta of 300 to the desired
rate. With choosing 2 as divisor however the resulting rate is 500 which
is nearer to 700.
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
