Skip to content

Commit f7275fd

Browse files
committed
Merge tag 'sunxi-clk-fixes-for-6.10' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-fixes
Pull one Allwinner SoC clk driver fix for 6.10 - Fix min/max rate clamping that caused a regression back in 6.9 * tag 'sunxi-clk-fixes-for-6.10' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi-ng: common: Don't call hw_to_ccu_common on hw without common
2 parents 2607133 + ea977d7 commit f7275fd

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

drivers/clk/sunxi-ng/ccu_common.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ static int sunxi_ccu_probe(struct sunxi_ccu *ccu, struct device *dev,
132132

133133
for (i = 0; i < desc->hw_clks->num ; i++) {
134134
struct clk_hw *hw = desc->hw_clks->hws[i];
135-
struct ccu_common *common = hw_to_ccu_common(hw);
136135
const char *name;
137136

138137
if (!hw)
@@ -147,14 +146,21 @@ static int sunxi_ccu_probe(struct sunxi_ccu *ccu, struct device *dev,
147146
pr_err("Couldn't register clock %d - %s\n", i, name);
148147
goto err_clk_unreg;
149148
}
149+
}
150+
151+
for (i = 0; i < desc->num_ccu_clks; i++) {
152+
struct ccu_common *cclk = desc->ccu_clks[i];
153+
154+
if (!cclk)
155+
continue;
150156

151-
if (common->max_rate)
152-
clk_hw_set_rate_range(hw, common->min_rate,
153-
common->max_rate);
157+
if (cclk->max_rate)
158+
clk_hw_set_rate_range(&cclk->hw, cclk->min_rate,
159+
cclk->max_rate);
154160
else
155-
WARN(common->min_rate,
161+
WARN(cclk->min_rate,
156162
"No max_rate, ignoring min_rate of clock %d - %s\n",
157-
i, name);
163+
i, clk_hw_get_name(&cclk->hw));
158164
}
159165

160166
ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get,

0 commit comments

Comments
 (0)