Skip to content

Commit 56d144d

Browse files
larsclausenbebarino
authored andcommitted
clk: hsdk-pll: Use managed of_clk_add_hw_provider()
Use the managed `devm_of_clk_add_hw_provider()` instead of `of_clk_add_hw_provider()`. This makes sure the provider gets automatically removed on unbind and allows to completely eliminate the drivers `remove()` callback. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20230410014502.27929-5-lars@metafoo.de Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent c2e59c7 commit 56d144d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/clk/clk-hsdk-pll.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,8 @@ static int hsdk_pll_clk_probe(struct platform_device *pdev)
346346
return ret;
347347
}
348348

349-
return of_clk_add_hw_provider(dev->of_node, of_clk_hw_simple_get,
350-
&pll_clk->hw);
351-
}
352-
353-
static void hsdk_pll_clk_remove(struct platform_device *pdev)
354-
{
355-
of_clk_del_provider(pdev->dev.of_node);
349+
return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get,
350+
&pll_clk->hw);
356351
}
357352

358353
static void __init of_hsdk_pll_clk_setup(struct device_node *node)
@@ -431,6 +426,5 @@ static struct platform_driver hsdk_pll_clk_driver = {
431426
.of_match_table = hsdk_pll_clk_id,
432427
},
433428
.probe = hsdk_pll_clk_probe,
434-
.remove_new = hsdk_pll_clk_remove,
435429
};
436430
builtin_platform_driver(hsdk_pll_clk_driver);

0 commit comments

Comments
 (0)