Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: clkfwk: bugfix: sh_clk_div_enable() care sh_clk_div_set_rate() if div6

764f4e4e33d18cde4dcaf8a0d860b749c6d6d08b
(sh: clkfwk: Use shared sh_clk_div_enable/disable())
shared enable/disable funcions for div4/div6.
But new sh_clk_div_enable() didn't care sh_clk_div_set_rate()
which is required on div6 clock.
This patch fixes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by

Kuninori Morimoto and committed by
Paul Mundt
5a799b82 30c254ff

+6
+6
drivers/sh/clk/cpg.c
··· 126 126 127 127 static int sh_clk_div_enable(struct clk *clk) 128 128 { 129 + if (clk->div_mask == SH_CLK_DIV6_MSK) { 130 + int ret = sh_clk_div_set_rate(clk, clk->rate); 131 + if (ret < 0) 132 + return ret; 133 + } 134 + 129 135 sh_clk_write(sh_clk_read(clk) & ~CPG_CKSTP_BIT, clk); 130 136 return 0; 131 137 }