Skip to content
Commit ff553ea1 authored by Boris Brezillon's avatar Boris Brezillon Committed by Michael Turquette
Browse files

clk: at91: usb: fix at91rm9200 round and set rate



at91rm9200_clk_usb_set_rate might fail depending on the requested rate,
because the parent_rate / rate remainder is not necessarily zero.
Moreover, when rounding down the calculated rate we might alter the
divisor calculation and end up with an invalid divisor.

To solve those problems, accept a non zero remainder, and always round
division to the closest result.

Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Reported-by: default avatarAndreas Henriksson <andreas.henriksson@endian.se>
Tested-by: default avatarAndreas Henriksson <andreas.henriksson@endian.se>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarMichael Turquette <mturquette@linaro.org>
parent 206c5f60
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment