Skip to content

Commit 4438512

Browse files
committed
Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
Pull clk fixes from Stephen Boyd: "A small fix for the newly added oxnas clk driver and a handful of rockchip clk driver fixes for newly added rk3399 support" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: Fix return value check in oxnas_stdclk_probe() clk: rockchip: release io resource when failing to init clk on rk3399 clk: rockchip: fix cpuclk registration error handling clk: rockchip: Revert "clk: rockchip: reset init state before mmc card initialization" clk: rockchip: fix incorrect parent for rk3399's {c,g}pll_aclk_perihp_src clk: rockchip: mark rk3399 GIC clocks as critical clk: rockchip: initialize flags of clk_init_data in mmc-phase clock
2 parents dbdc3bb + 0863477 commit 4438512

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

drivers/clk/clk-oxnas.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ static int oxnas_stdclk_probe(struct platform_device *pdev)
144144
return -ENOMEM;
145145

146146
regmap = syscon_node_to_regmap(of_get_parent(np));
147-
if (!regmap) {
147+
if (IS_ERR(regmap)) {
148148
dev_err(&pdev->dev, "failed to have parent regmap\n");
149-
return -EINVAL;
149+
return PTR_ERR(regmap);
150150
}
151151

152152
for (i = 0; i < ARRAY_SIZE(clk_oxnas_init); i++) {

drivers/clk/rockchip/clk-cpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,9 @@ struct clk *rockchip_clk_register_cpuclk(const char *name,
321321
}
322322

323323
cclk = clk_register(NULL, &cpuclk->hw);
324-
if (IS_ERR(clk)) {
324+
if (IS_ERR(cclk)) {
325325
pr_err("%s: could not register cpuclk %s\n", __func__, name);
326-
ret = PTR_ERR(clk);
326+
ret = PTR_ERR(cclk);
327327
goto free_rate_table;
328328
}
329329

drivers/clk/rockchip/clk-mmc-phase.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ static unsigned long rockchip_mmc_recalc(struct clk_hw *hw,
4141
#define ROCKCHIP_MMC_DEGREE_MASK 0x3
4242
#define ROCKCHIP_MMC_DELAYNUM_OFFSET 2
4343
#define ROCKCHIP_MMC_DELAYNUM_MASK (0xff << ROCKCHIP_MMC_DELAYNUM_OFFSET)
44-
#define ROCKCHIP_MMC_INIT_STATE_RESET 0x1
45-
#define ROCKCHIP_MMC_INIT_STATE_SHIFT 1
4644

4745
#define PSECS_PER_SEC 1000000000000LL
4846

@@ -154,6 +152,7 @@ struct clk *rockchip_clk_register_mmc(const char *name,
154152
return ERR_PTR(-ENOMEM);
155153

156154
init.name = name;
155+
init.flags = 0;
157156
init.num_parents = num_parents;
158157
init.parent_names = parent_names;
159158
init.ops = &rockchip_mmc_clk_ops;
@@ -162,15 +161,6 @@ struct clk *rockchip_clk_register_mmc(const char *name,
162161
mmc_clock->reg = reg;
163162
mmc_clock->shift = shift;
164163

165-
/*
166-
* Assert init_state to soft reset the CLKGEN
167-
* for mmc tuning phase and degree
168-
*/
169-
if (mmc_clock->shift == ROCKCHIP_MMC_INIT_STATE_SHIFT)
170-
writel(HIWORD_UPDATE(ROCKCHIP_MMC_INIT_STATE_RESET,
171-
ROCKCHIP_MMC_INIT_STATE_RESET,
172-
mmc_clock->shift), mmc_clock->reg);
173-
174164
clk = clk_register(NULL, &mmc_clock->hw);
175165
if (IS_ERR(clk))
176166
kfree(mmc_clock);

drivers/clk/rockchip/clk-rk3399.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,9 +832,9 @@ static struct rockchip_clk_branch rk3399_clk_branches[] __initdata = {
832832
RK3399_CLKGATE_CON(13), 1, GFLAGS),
833833

834834
/* perihp */
835-
GATE(0, "cpll_aclk_perihp_src", "gpll", CLK_IGNORE_UNUSED,
835+
GATE(0, "cpll_aclk_perihp_src", "cpll", CLK_IGNORE_UNUSED,
836836
RK3399_CLKGATE_CON(5), 0, GFLAGS),
837-
GATE(0, "gpll_aclk_perihp_src", "cpll", CLK_IGNORE_UNUSED,
837+
GATE(0, "gpll_aclk_perihp_src", "gpll", CLK_IGNORE_UNUSED,
838838
RK3399_CLKGATE_CON(5), 1, GFLAGS),
839839
COMPOSITE(ACLK_PERIHP, "aclk_perihp", mux_aclk_perihp_p, CLK_IGNORE_UNUSED,
840840
RK3399_CLKSEL_CON(14), 7, 1, MFLAGS, 0, 5, DFLAGS,
@@ -1466,6 +1466,8 @@ static struct rockchip_clk_branch rk3399_clk_pmu_branches[] __initdata = {
14661466

14671467
static const char *const rk3399_cru_critical_clocks[] __initconst = {
14681468
"aclk_cci_pre",
1469+
"aclk_gic",
1470+
"aclk_gic_noc",
14691471
"pclk_perilp0",
14701472
"pclk_perilp0",
14711473
"hclk_perilp0",
@@ -1508,6 +1510,7 @@ static void __init rk3399_clk_init(struct device_node *np)
15081510
ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS);
15091511
if (IS_ERR(ctx)) {
15101512
pr_err("%s: rockchip clk init failed\n", __func__);
1513+
iounmap(reg_base);
15111514
return;
15121515
}
15131516

@@ -1553,6 +1556,7 @@ static void __init rk3399_pmu_clk_init(struct device_node *np)
15531556
ctx = rockchip_clk_init(np, reg_base, CLKPMU_NR_CLKS);
15541557
if (IS_ERR(ctx)) {
15551558
pr_err("%s: rockchip pmu clk init failed\n", __func__);
1559+
iounmap(reg_base);
15561560
return;
15571561
}
15581562

0 commit comments

Comments
 (0)