clk: intel: Use devm_clk_hw_register() instead of clk_hw_register()

To ensure that clks are unregistered in case of any failure, use
devm_clk_hw_register() instead of clk_hw_register().

Signed-off-by: Rahul Tanwar <rahul.tanwar@linux.intel.com>
Link: https://lore.kernel.org/r/7ef7009b4e9f986fd6dfbf487c0e85de68a4ba9b.1594880946.git.rahul.tanwar@linux.intel.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
Rahul Tanwar 2020-07-16 14:30:30 +08:00 committed by Stephen Boyd
parent b3a9e3b962
commit 8529fc0aaa
2 changed files with 5 additions and 5 deletions

View File

@ -128,7 +128,7 @@ lgm_clk_register_pll(struct lgm_clk_provider *ctx,
pll->hw.init = &init;
hw = &pll->hw;
ret = clk_hw_register(dev, hw);
ret = devm_clk_hw_register(dev, hw);
if (ret)
return ERR_PTR(ret);

View File

@ -119,7 +119,7 @@ lgm_clk_register_mux(struct lgm_clk_provider *ctx,
mux->hw.init = &init;
hw = &mux->hw;
ret = clk_hw_register(dev, hw);
ret = devm_clk_hw_register(dev, hw);
if (ret)
return ERR_PTR(ret);
@ -247,7 +247,7 @@ lgm_clk_register_divider(struct lgm_clk_provider *ctx,
div->hw.init = &init;
hw = &div->hw;
ret = clk_hw_register(dev, hw);
ret = devm_clk_hw_register(dev, hw);
if (ret)
return ERR_PTR(ret);
@ -361,7 +361,7 @@ lgm_clk_register_gate(struct lgm_clk_provider *ctx,
gate->hw.init = &init;
hw = &gate->hw;
ret = clk_hw_register(dev, hw);
ret = devm_clk_hw_register(dev, hw);
if (ret)
return ERR_PTR(ret);
@ -624,7 +624,7 @@ int lgm_clk_register_ddiv(struct lgm_clk_provider *ctx,
ddiv->hw.init = &init;
hw = &ddiv->hw;
ret = clk_hw_register(dev, hw);
ret = devm_clk_hw_register(dev, hw);
if (ret) {
dev_err(dev, "register clk: %s failed!\n", list->name);
return ret;