Skip to content

Commit c0e1952

Browse files
larsclausenbebarino
authored andcommitted
clk: uniphier: 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-11-lars@metafoo.de Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 361dde3 commit c0e1952

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/clk/uniphier/clk-uniphier-core.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,8 @@ static int uniphier_clk_probe(struct platform_device *pdev)
8787
hw_data->hws[p->idx] = hw;
8888
}
8989

90-
return of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
91-
hw_data);
92-
}
93-
94-
static void uniphier_clk_remove(struct platform_device *pdev)
95-
{
96-
of_clk_del_provider(pdev->dev.of_node);
90+
return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
91+
hw_data);
9792
}
9893

9994
static const struct of_device_id uniphier_clk_match[] = {
@@ -218,7 +213,6 @@ static const struct of_device_id uniphier_clk_match[] = {
218213

219214
static struct platform_driver uniphier_clk_driver = {
220215
.probe = uniphier_clk_probe,
221-
.remove_new = uniphier_clk_remove,
222216
.driver = {
223217
.name = "uniphier-clk",
224218
.of_match_table = uniphier_clk_match,

0 commit comments

Comments
 (0)