[RFC PATCH 11/16] clk: hifiberry-dacpro: transition to _hw functions
Pierre-Louis Bossart
pierre-louis.bossart at linux.intel.com
Thu Apr 9 21:58:36 CEST 2020
devm_clk_register() and of_clk_add_provider() are deprecated, use the
recommended functions.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
---
drivers/clk/clk-hifiberry-dacpro.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/clk/clk-hifiberry-dacpro.c b/drivers/clk/clk-hifiberry-dacpro.c
index 78ede325d237..bf0616c959da 100644
--- a/drivers/clk/clk-hifiberry-dacpro.c
+++ b/drivers/clk/clk-hifiberry-dacpro.c
@@ -91,7 +91,6 @@ static int clk_hifiberry_dacpro_probe(struct platform_device *pdev)
struct clk_hifiberry_hw *proclk;
struct clk_init_data init;
struct device *dev;
- struct clk *clk;
int ret;
dev = &pdev->dev;
@@ -109,14 +108,15 @@ static int clk_hifiberry_dacpro_probe(struct platform_device *pdev)
proclk->mode = 0;
proclk->hw.init = &init;
- clk = devm_clk_register(dev, &proclk->hw);
- if (!IS_ERR(clk)) {
- ret = of_clk_add_provider(dev->of_node, of_clk_src_simple_get,
- clk);
- } else {
+ ret = devm_clk_hw_register(dev, &proclk->hw);
+ if (ret) {
dev_err(dev, "Fail to register clock driver\n");
- ret = PTR_ERR(clk);
+ return ret;
}
+
+ ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_simple_get,
+ &proclk->hw);
+
return ret;
}
--
2.20.1
More information about the Alsa-devel
mailing list