Skip to content

Commit a52ae5a

Browse files
author
Mike Turquette
committed
Merge branch 'clk-fixes' into clk-next
2 parents 0469a43 + 8ce8ebe commit a52ae5a

7 files changed

Lines changed: 24 additions & 10 deletions

File tree

‎drivers/clk/at91/clk-slow.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ void __init of_at91sam9260_clk_slow_setup(struct device_node *np,
447447
int i;
448448

449449
num_parents = of_count_phandle_with_args(np, "clocks", "#clock-cells");
450-
if (num_parents <= 0 || num_parents > 1)
450+
if (num_parents != 2)
451451
return;
452452

453453
for (i = 0; i < num_parents; ++i) {

‎drivers/clk/clk-efm32gg.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static struct clk_onecell_data clk_data = {
2222
.clk_num = ARRAY_SIZE(clk),
2323
};
2424

25-
static int __init efm32gg_cmu_init(struct device_node *np)
25+
static void __init efm32gg_cmu_init(struct device_node *np)
2626
{
2727
int i;
2828
void __iomem *base;
@@ -33,7 +33,7 @@ static int __init efm32gg_cmu_init(struct device_node *np)
3333
base = of_iomap(np, 0);
3434
if (!base) {
3535
pr_warn("Failed to map address range for efm32gg,cmu node\n");
36-
return -EADDRNOTAVAIL;
36+
return;
3737
}
3838

3939
clk[clk_HFXO] = clk_register_fixed_rate(NULL, "HFXO", NULL,
@@ -76,6 +76,6 @@ static int __init efm32gg_cmu_init(struct device_node *np)
7676
clk[clk_HFPERCLKDAC0] = clk_register_gate(NULL, "HFPERCLK.DAC0",
7777
"HFXO", 0, base + CMU_HFPERCLKEN0, 17, 0, NULL);
7878

79-
return of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
79+
of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
8080
}
8181
CLK_OF_DECLARE(efm32ggcmu, "efm32gg,cmu", efm32gg_cmu_init);

‎drivers/clk/clk.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,7 @@ static struct clk *clk_propagate_rate_change(struct clk *clk, unsigned long even
14491449
static void clk_change_rate(struct clk *clk)
14501450
{
14511451
struct clk *child;
1452+
struct hlist_node *tmp;
14521453
unsigned long old_rate;
14531454
unsigned long best_parent_rate = 0;
14541455
bool skip_set_rate = false;
@@ -1484,7 +1485,11 @@ static void clk_change_rate(struct clk *clk)
14841485
if (clk->notifier_count && old_rate != clk->rate)
14851486
__clk_notify(clk, POST_RATE_CHANGE, old_rate, clk->rate);
14861487

1487-
hlist_for_each_entry(child, &clk->children, child_node) {
1488+
/*
1489+
* Use safe iteration, as change_rate can actually swap parents
1490+
* for certain clock types.
1491+
*/
1492+
hlist_for_each_entry_safe(child, tmp, &clk->children, child_node) {
14881493
/* Skip children who will be reparented to another clock */
14891494
if (child->new_parent && child->new_parent != clk)
14901495
continue;

‎drivers/clk/qcom/gcc-ipq806x.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ static struct clk_branch prng_clk = {
10951095
};
10961096

10971097
static const struct freq_tbl clk_tbl_sdc[] = {
1098-
{ 144000, P_PXO, 5, 18,625 },
1098+
{ 200000, P_PXO, 2, 2, 125 },
10991099
{ 400000, P_PLL8, 4, 1, 240 },
11001100
{ 16000000, P_PLL8, 4, 1, 6 },
11011101
{ 17070000, P_PLL8, 1, 2, 45 },

‎drivers/clk/rockchip/clk-rk3288.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
545545
GATE(PCLK_PWM, "pclk_pwm", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 0, GFLAGS),
546546
GATE(PCLK_TIMER, "pclk_timer", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 1, GFLAGS),
547547
GATE(PCLK_I2C0, "pclk_i2c0", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 2, GFLAGS),
548-
GATE(PCLK_I2C1, "pclk_i2c1", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 3, GFLAGS),
548+
GATE(PCLK_I2C2, "pclk_i2c2", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 3, GFLAGS),
549549
GATE(0, "pclk_ddrupctl0", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 14, GFLAGS),
550550
GATE(0, "pclk_publ0", "pclk_cpu", 0, RK3288_CLKGATE_CON(10), 15, GFLAGS),
551551
GATE(0, "pclk_ddrupctl1", "pclk_cpu", 0, RK3288_CLKGATE_CON(11), 0, GFLAGS),
@@ -603,7 +603,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
603603
GATE(PCLK_I2C4, "pclk_i2c4", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 15, GFLAGS),
604604
GATE(PCLK_UART3, "pclk_uart3", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 11, GFLAGS),
605605
GATE(PCLK_UART4, "pclk_uart4", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 12, GFLAGS),
606-
GATE(PCLK_I2C2, "pclk_i2c2", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 13, GFLAGS),
606+
GATE(PCLK_I2C1, "pclk_i2c1", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 13, GFLAGS),
607607
GATE(PCLK_I2C3, "pclk_i2c3", "pclk_peri", 0, RK3288_CLKGATE_CON(6), 14, GFLAGS),
608608
GATE(PCLK_SARADC, "pclk_saradc", "pclk_peri", 0, RK3288_CLKGATE_CON(7), 1, GFLAGS),
609609
GATE(PCLK_TSADC, "pclk_tsadc", "pclk_peri", 0, RK3288_CLKGATE_CON(7), 2, GFLAGS),

‎drivers/clk/ti/clk-dra7-atl.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,13 @@ static long atl_clk_round_rate(struct clk_hw *hw, unsigned long rate,
139139
static int atl_clk_set_rate(struct clk_hw *hw, unsigned long rate,
140140
unsigned long parent_rate)
141141
{
142-
struct dra7_atl_desc *cdesc = to_atl_desc(hw);
142+
struct dra7_atl_desc *cdesc;
143143
u32 divider;
144144

145+
if (!hw || !rate)
146+
return -EINVAL;
147+
148+
cdesc = to_atl_desc(hw);
145149
divider = ((parent_rate + rate / 2) / rate) - 1;
146150
if (divider > DRA7_ATL_DIVIDER_MASK)
147151
divider = DRA7_ATL_DIVIDER_MASK;

‎drivers/clk/ti/divider.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,16 @@ static long ti_clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
211211
static int ti_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
212212
unsigned long parent_rate)
213213
{
214-
struct clk_divider *divider = to_clk_divider(hw);
214+
struct clk_divider *divider;
215215
unsigned int div, value;
216216
unsigned long flags = 0;
217217
u32 val;
218218

219+
if (!hw || !rate)
220+
return -EINVAL;
221+
222+
divider = to_clk_divider(hw);
223+
219224
div = DIV_ROUND_UP(parent_rate, rate);
220225
value = _get_val(divider, div);
221226

0 commit comments

Comments
 (0)