diff options
| author | Srinivas Kandagatla <[email protected]> | 2022-02-24 11:17:05 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2022-02-25 13:51:00 +0000 |
| commit | db8665a3e904f579840417f9414415c4dd54ac84 (patch) | |
| tree | 7977836dab3d16a247949d35e08c26f55015976c /sound/soc/codecs/lpass-tx-macro.c | |
| parent | ASoC: codecs: rx-macro: move clk provider to managed variants (diff) | |
| download | kernel-db8665a3e904f579840417f9414415c4dd54ac84.tar.gz kernel-db8665a3e904f579840417f9414415c4dd54ac84.zip | |
ASoC: codecs: tx-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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'sound/soc/codecs/lpass-tx-macro.c')
| -rw-r--r-- | sound/soc/codecs/lpass-tx-macro.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c index 9c96ab1bf84f..e87fe1cf7307 100644 --- a/sound/soc/codecs/lpass-tx-macro.c +++ b/sound/soc/codecs/lpass-tx-macro.c @@ -1739,10 +1739,9 @@ static const struct clk_ops swclk_gate_ops = { }; -static struct clk *tx_macro_register_mclk_output(struct tx_macro *tx) +static int tx_macro_register_mclk_output(struct tx_macro *tx) { struct device *dev = tx->dev; - struct device_node *np = dev->of_node; const char *parent_clk_name = NULL; const char *clk_name = "lpass-tx-mclk"; struct clk_hw *hw; @@ -1758,13 +1757,11 @@ static struct clk *tx_macro_register_mclk_output(struct tx_macro *tx) init.num_parents = 1; tx->hw.init = &init; hw = &tx->hw; - ret = clk_hw_register(tx->dev, hw); + ret = devm_clk_hw_register(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 tx_macro_component_drv = { @@ -1837,7 +1834,9 @@ static int tx_macro_probe(struct platform_device *pdev) if (ret) return ret; - tx_macro_register_mclk_output(tx); + ret = tx_macro_register_mclk_output(tx); + if (ret) + goto err; ret = devm_snd_soc_register_component(dev, &tx_macro_component_drv, tx_macro_dai, @@ -1855,8 +1854,6 @@ static int tx_macro_remove(struct platform_device *pdev) { struct tx_macro *tx = dev_get_drvdata(&pdev->dev); - of_clk_del_provider(pdev->dev.of_node); - clk_bulk_disable_unprepare(TX_NUM_CLKS_MAX, tx->clks); return 0; |
