Skip to content

Commit 7288de7

Browse files
mszyprowSylwester Nawrocki
authored andcommitted
clk: samsung: Add local variable to match its purpose
Add new variable to avoid using clk pointer for different purposes across the exynos_register_cpu_clock() function. This will help in future rewrite for the new clk_hw API. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]>
1 parent 9f57fd6 commit 7288de7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/clk/samsung/clk-cpu.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ int __init exynos_register_cpu_clock(struct samsung_clk_provider *ctx,
410410
{
411411
struct exynos_cpuclk *cpuclk;
412412
struct clk_init_data init;
413+
struct clk *parent_clk;
413414
struct clk *clk;
414415
int ret = 0;
415416

@@ -440,15 +441,15 @@ int __init exynos_register_cpu_clock(struct samsung_clk_provider *ctx,
440441
goto free_cpuclk;
441442
}
442443

443-
clk = __clk_lookup(parent);
444-
if (!clk) {
444+
parent_clk = __clk_lookup(parent);
445+
if (!parent_clk) {
445446
pr_err("%s: could not lookup parent clock %s\n",
446447
__func__, parent);
447448
ret = -EINVAL;
448449
goto free_cpuclk;
449450
}
450451

451-
ret = clk_notifier_register(clk, &cpuclk->clk_nb);
452+
ret = clk_notifier_register(parent_clk, &cpuclk->clk_nb);
452453
if (ret) {
453454
pr_err("%s: failed to register clock notifier for %s\n",
454455
__func__, name);
@@ -476,7 +477,7 @@ int __init exynos_register_cpu_clock(struct samsung_clk_provider *ctx,
476477
free_cpuclk_data:
477478
kfree(cpuclk->cfg);
478479
unregister_clk_nb:
479-
clk_notifier_unregister(__clk_lookup(parent), &cpuclk->clk_nb);
480+
clk_notifier_unregister(parent_clk, &cpuclk->clk_nb);
480481
free_cpuclk:
481482
kfree(cpuclk);
482483
return ret;

0 commit comments

Comments
 (0)