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: NBoris Brezillon <boris.brezillon@free-electrons.com> Reported-by: NAndreas Henriksson <andreas.henriksson@endian.se> Tested-by: NAndreas Henriksson <andreas.henriksson@endian.se> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMichael Turquette <mturquette@linaro.org>
Showing
想要评论请 注册 或 登录