linux/drivers/clk/at91
Boris Brezillon f16f64f9e4 clk: at91: usb: fix at91sam9x5 recalc, round and set rate
commit 69daf75aaf upstream.

First check for rate == 0 in set_rate and round_rate to avoid div by zero.
Then, in order to get the closest rate, round all divisions to the closest
result instead of rounding them down.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
[ luis: 3.16 prereq for:
  4591243102 "clk: at91: usb: propagate rate modification to the parent clk" ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2015-05-06 10:24:17 +01:00
..
clk-main.c clk: at91: rework main clk implementation 2014-05-07 18:27:22 +02:00
clk-master.c clk:at91: Fix memory leak in of_at91_clk_master_setup() 2014-02-26 18:00:56 -08:00
clk-peripheral.c clk: at91: add PMC peripheral clocks 2013-12-02 15:31:24 +01:00
clk-pll.c clk: at91: add PMC master clock 2013-12-02 15:31:23 +01:00
clk-plldiv.c clk: at91: add PMC pll clocks 2013-12-02 15:31:22 +01:00
clk-programmable.c clk: at91: optimization of the set_rate callback 2014-03-19 15:22:02 -07:00
clk-slow.c clk: at91: keep slow clk enabled to prevent system hang 2015-01-22 16:33:29 +00:00
clk-smd.c clk: at91: add PMC smd clock 2013-12-02 15:31:25 +01:00
clk-system.c clk: at91: fix programmable clk irq handling 2014-03-19 15:21:56 -07:00
clk-usb.c clk: at91: usb: fix at91sam9x5 recalc, round and set rate 2015-05-06 10:24:17 +01:00
clk-utmi.c clk: at91: add PMC utmi clock 2013-12-02 15:31:25 +01:00
Makefile clk: at91: add slow clks driver 2014-05-07 18:27:45 +02:00
pmc.c clk: at91: add slow clks driver 2014-05-07 18:27:45 +02:00
pmc.h clk: at91: add slow clks driver 2014-05-07 18:27:45 +02:00
sckc.c clk: at91: add slow clks driver 2014-05-07 18:27:45 +02:00
sckc.h clk: at91: add slow clks driver 2014-05-07 18:27:45 +02:00