Skip to content

Commit

Permalink
clk: qcom: rpm: 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>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230410014502.27929-7-lars@metafoo.de
  • Loading branch information
Lars-Peter Clausen authored and Bjorn Andersson committed Apr 12, 2023
1 parent d75b82c commit f1f67db
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/clk/qcom/clk-rpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,8 @@ static int rpm_clk_probe(struct platform_device *pdev)
goto err;
}

ret = of_clk_add_hw_provider(pdev->dev.of_node, qcom_rpm_clk_hw_get,
rcc);
ret = devm_of_clk_add_hw_provider(&pdev->dev, qcom_rpm_clk_hw_get,
rcc);
if (ret)
goto err;

Expand All @@ -591,18 +591,12 @@ static int rpm_clk_probe(struct platform_device *pdev)
return ret;
}

static void rpm_clk_remove(struct platform_device *pdev)
{
of_clk_del_provider(pdev->dev.of_node);
}

static struct platform_driver rpm_clk_driver = {
.driver = {
.name = "qcom-clk-rpm",
.of_match_table = rpm_clk_match_table,
},
.probe = rpm_clk_probe,
.remove_new = rpm_clk_remove,
};

static int __init rpm_clk_init(void)
Expand Down

0 comments on commit f1f67db

Please sign in to comment.