summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/lpass-rx-macro.c
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2022-02-24 12:17:04 +0100
committerMark Brown <broonie@kernel.org>2022-02-25 14:50:59 +0100
commit70a5e96bad592145ba25365689a2d7d8dedb3bd9 (patch)
tree22ea8b13cb1cd99fd219915fb81cd95cedb38c24 /sound/soc/codecs/lpass-rx-macro.c
parentASoC: codecs: va-macro: move to individual clks from bulk (diff)
downloadlinux-70a5e96bad592145ba25365689a2d7d8dedb3bd9.tar.xz
linux-70a5e96bad592145ba25365689a2d7d8dedb3bd9.zip
ASoC: codecs: rx-macro: move clk provider to managed variants
move clk provider registration to managed api variants, this should help with some code tidyup. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20220224111718.6264-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/lpass-rx-macro.c')
-rw-r--r--sound/soc/codecs/lpass-rx-macro.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
index 29d214f784d1..0822fe618d50 100644
--- a/sound/soc/codecs/lpass-rx-macro.c
+++ b/sound/soc/codecs/lpass-rx-macro.c
@@ -3475,10 +3475,9 @@ static const struct clk_ops swclk_gate_ops = {
};
-static struct clk *rx_macro_register_mclk_output(struct rx_macro *rx)
+static int rx_macro_register_mclk_output(struct rx_macro *rx)
{
struct device *dev = rx->dev;
- struct device_node *np = dev->of_node;
const char *parent_clk_name = NULL;
const char *clk_name = "lpass-rx-mclk";
struct clk_hw *hw;
@@ -3494,13 +3493,11 @@ static struct clk *rx_macro_register_mclk_output(struct rx_macro *rx)
init.num_parents = 1;
rx->hw.init = &init;
hw = &rx->hw;
- ret = clk_hw_register(rx->dev, hw);
+ ret = devm_clk_hw_register(rx->dev, hw);
if (ret)
- return ERR_PTR(ret);
-
- of_clk_add_provider(np, of_clk_src_simple_get, hw->clk);
+ return ret;
- return NULL;
+ return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, hw);
}
static const struct snd_soc_component_driver rx_macro_component_drv = {
@@ -3558,22 +3555,26 @@ static int rx_macro_probe(struct platform_device *pdev)
if (ret)
return ret;
- rx_macro_register_mclk_output(rx);
+ ret = rx_macro_register_mclk_output(rx);
+ if (ret)
+ goto err;
ret = devm_snd_soc_register_component(dev, &rx_macro_component_drv,
rx_macro_dai,
ARRAY_SIZE(rx_macro_dai));
if (ret)
- clk_bulk_disable_unprepare(RX_NUM_CLKS_MAX, rx->clks);
+ goto err;
return ret;
+err:
+ clk_bulk_disable_unprepare(RX_NUM_CLKS_MAX, rx->clks);
+ return ret;
}
static int rx_macro_remove(struct platform_device *pdev)
{
struct rx_macro *rx = dev_get_drvdata(&pdev->dev);
- of_clk_del_provider(pdev->dev.of_node);
clk_bulk_disable_unprepare(RX_NUM_CLKS_MAX, rx->clks);
return 0;
}