diff options
author | Mike Turquette <mturquette@ti.com> | 2011-10-18 16:47:52 -0500 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-10-01 12:55:37 +0200 |
commit | 6e956349e4f47877258a827b3a5ce1a24a62ee7c (patch) | |
tree | 00e46b7388129e438f8688ab00d72e47c06cac50 /arch | |
parent | 56d6044a2e3a8cabb31d134f43a3ee266f888115 (diff) | |
download | kernel_samsung_tuna-6e956349e4f47877258a827b3a5ce1a24a62ee7c.zip kernel_samsung_tuna-6e956349e4f47877258a827b3a5ce1a24a62ee7c.tar.gz kernel_samsung_tuna-6e956349e4f47877258a827b3a5ce1a24a62ee7c.tar.bz2 |
omap: clock: not all clocks have .round_rate
Protect clk_set_rate function from the case where a clock does
not have a round_rate function pointer. In such a case we simply
continue with the assumption that the rate passed into clk_set_rate
is OK.
This seems a bit dubious but if a clock does not have a round_rate
it is assumed it also does not have a set_rate function and will be
handled properly by clk_set_rate.
Change-Id: Ib0cce595fe42bbb450cb91196727b14823900bfe
Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Margarita Olaya <magi.olaya@ti.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/plat-omap/clock.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index 7f0582d..97c381f 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c @@ -195,7 +195,11 @@ int clk_set_rate(struct clk *clk, unsigned long rate) if (!arch_clock || !arch_clock->clk_set_rate) return ret; - new_rate = clk->round_rate(clk, rate); + if (clk->round_rate) + new_rate = clk->round_rate(clk, rate); + else + new_rate = rate; + omap_clk_notify_downstream(clk, CLK_PRE_RATE_CHANGE, new_rate); spin_lock_irqsave(&clockfw_lock, flags); |