Message ID | 20230410014502.27929-7-lars@metafoo.de (mailing list archive) |
---|---|
State | Awaiting Upstream, archived |
Headers | show |
Series | [01/11] clk: axi-clkgen: Use managed `of_clk_add_hw_provider()` | expand |
Quoting Lars-Peter Clausen (2023-04-09 18:44:58) > 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> > --- Needs to go via qcom clk tree. Reviewed-by: Stephen Boyd <sboyd@kernel.org>
diff --git a/drivers/clk/qcom/clk-rpm.c b/drivers/clk/qcom/clk-rpm.c index b1be5b664bf3..cac623e27b0e 100644 --- a/drivers/clk/qcom/clk-rpm.c +++ b/drivers/clk/qcom/clk-rpm.c @@ -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; @@ -591,19 +591,12 @@ static int rpm_clk_probe(struct platform_device *pdev) return ret; } -static int rpm_clk_remove(struct platform_device *pdev) -{ - of_clk_del_provider(pdev->dev.of_node); - return 0; -} - static struct platform_driver rpm_clk_driver = { .driver = { .name = "qcom-clk-rpm", .of_match_table = rpm_clk_match_table, }, .probe = rpm_clk_probe, - .remove = rpm_clk_remove, }; static int __init rpm_clk_init(void)
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> --- drivers/clk/qcom/clk-rpm.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)