Skip to content

Commit

Permalink
clk: clk-loongson2: Switch to use devm_clk_hw_register_fixed_rate_par…
Browse files Browse the repository at this point in the history
…ent_data()

Since commit 706ae64 ("clk: fixed-rate: add
devm_clk_hw_register_fixed_rate_parent_data()"), we can use the
devm_clk_hw_register_fixed_rate_parent_data() helper and from then on
there is no need to manually unregister the fixed rate hw.

Since clk_hw_unregister_fixed_rate() was not called before, we also fix
the memory leak that was present.

Signed-off-by: Binbin Zhou <[email protected]>
Link: https://lore.kernel.org/r/8733a7485619bdb791de25201a3d7984d1849c9f.1736856470.git.zhoubinbin@loongson.cn
Signed-off-by: Stephen Boyd <[email protected]>
  • Loading branch information
Binbin Zhou authored and bebarino committed Jan 14, 2025
1 parent 838c0a4 commit 54e020b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/clk/clk-loongson2.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ static int loongson2_clk_probe(struct platform_device *pdev)
&clp->clk_lock);
break;
case CLK_TYPE_FIXED:
hw = clk_hw_register_fixed_rate_parent_data(dev, p->name, pdata,
0, p->fixed_rate);
hw = devm_clk_hw_register_fixed_rate_parent_data(dev, p->name, pdata,
0, p->fixed_rate);
break;
default:
return dev_err_probe(dev, -EINVAL, "Invalid clk type\n");
Expand Down

0 comments on commit 54e020b

Please sign in to comment.