Skip to content

Commit 56fc9a3

Browse files
larsclausenbebarino
authored andcommitted
clk: lmk04832: 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. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20230410014502.27929-6-lars@metafoo.de Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 56d144d commit 56fc9a3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/clk/clk-lmk04832.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,8 +1522,8 @@ static int lmk04832_probe(struct spi_device *spi)
15221522
}
15231523

15241524
lmk->clk_data->num = info->num_channels;
1525-
ret = of_clk_add_hw_provider(lmk->dev->of_node, of_clk_hw_onecell_get,
1526-
lmk->clk_data);
1525+
ret = devm_of_clk_add_hw_provider(lmk->dev, of_clk_hw_onecell_get,
1526+
lmk->clk_data);
15271527
if (ret) {
15281528
dev_err(lmk->dev, "failed to add provider (%d)\n", ret);
15291529
goto err_disable_vco;
@@ -1547,7 +1547,6 @@ static void lmk04832_remove(struct spi_device *spi)
15471547
struct lmk04832 *lmk = spi_get_drvdata(spi);
15481548

15491549
clk_disable_unprepare(lmk->oscin);
1550-
of_clk_del_provider(spi->dev.of_node);
15511550
}
15521551

15531552
static const struct spi_device_id lmk04832_id[] = {

0 commit comments

Comments
 (0)