Skip to content

Commit

Permalink
clk: uniphier: Use managed of_clk_add_hw_provider()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lars-Peter Clausen authored and Stephen Boyd committed Apr 10, 2023
1 parent 361dde3 commit c0e1952
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/clk/uniphier/clk-uniphier-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,8 @@ static int uniphier_clk_probe(struct platform_device *pdev)
hw_data->hws[p->idx] = hw;
}

return of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
hw_data);
}

static void uniphier_clk_remove(struct platform_device *pdev)
{
of_clk_del_provider(pdev->dev.of_node);
return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
hw_data);
}

static const struct of_device_id uniphier_clk_match[] = {
Expand Down Expand Up @@ -218,7 +213,6 @@ static const struct of_device_id uniphier_clk_match[] = {

static struct platform_driver uniphier_clk_driver = {
.probe = uniphier_clk_probe,
.remove_new = uniphier_clk_remove,
.driver = {
.name = "uniphier-clk",
.of_match_table = uniphier_clk_match,
Expand Down

0 comments on commit c0e1952

Please sign in to comment.