mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-08 05:34:29 +08:00
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>
This commit is contained in:
parent
bed1775752
commit
70a5e96bad
@ -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);
|
||||
return ret;
|
||||
|
||||
of_clk_add_provider(np, of_clk_src_simple_get, hw->clk);
|
||||
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user