Commit c97c4604 authored by Wei Yongjun's avatar Wei Yongjun Committed by Mark Brown

ASoC: sun4i-spdif: drop unnessary snd_soc_unregister_component()

It's not necessary to unregister a component registered
with devm_snd_soc_register_component(). Also removed
pointness clk_disable_unprepare() from error path and
snd_soc_unregister_platform() from the remove.

Fixes: f8260afa ("ASoC: sunxi: Add support for the SPDIF block")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f55d404f
...@@ -510,8 +510,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev) ...@@ -510,8 +510,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
host->spdif_clk = devm_clk_get(&pdev->dev, "spdif"); host->spdif_clk = devm_clk_get(&pdev->dev, "spdif");
if (IS_ERR(host->spdif_clk)) { if (IS_ERR(host->spdif_clk)) {
dev_err(&pdev->dev, "failed to get a spdif clock.\n"); dev_err(&pdev->dev, "failed to get a spdif clock.\n");
ret = PTR_ERR(host->spdif_clk); return PTR_ERR(host->spdif_clk);
goto err_disable_apb_clk;
} }
host->dma_params_tx.addr = res->start + quirks->reg_dac_txdata; host->dma_params_tx.addr = res->start + quirks->reg_dac_txdata;
...@@ -525,7 +524,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev) ...@@ -525,7 +524,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
if (IS_ERR(host->rst) && PTR_ERR(host->rst) == -EPROBE_DEFER) { if (IS_ERR(host->rst) && PTR_ERR(host->rst) == -EPROBE_DEFER) {
ret = -EPROBE_DEFER; ret = -EPROBE_DEFER;
dev_err(&pdev->dev, "Failed to get reset: %d\n", ret); dev_err(&pdev->dev, "Failed to get reset: %d\n", ret);
goto err_disable_apb_clk; return ret;
} }
if (!IS_ERR(host->rst)) if (!IS_ERR(host->rst))
reset_control_deassert(host->rst); reset_control_deassert(host->rst);
...@@ -534,7 +533,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev) ...@@ -534,7 +533,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_component(&pdev->dev, ret = devm_snd_soc_register_component(&pdev->dev,
&sun4i_spdif_component, &sun4i_spdif_dai, 1); &sun4i_spdif_component, &sun4i_spdif_dai, 1);
if (ret) if (ret)
goto err_disable_apb_clk; return ret;
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
if (!pm_runtime_enabled(&pdev->dev)) { if (!pm_runtime_enabled(&pdev->dev)) {
...@@ -552,9 +551,6 @@ static int sun4i_spdif_probe(struct platform_device *pdev) ...@@ -552,9 +551,6 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
sun4i_spdif_runtime_suspend(&pdev->dev); sun4i_spdif_runtime_suspend(&pdev->dev);
err_unregister: err_unregister:
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
snd_soc_unregister_component(&pdev->dev);
err_disable_apb_clk:
clk_disable_unprepare(host->apb_clk);
return ret; return ret;
} }
...@@ -564,9 +560,6 @@ static int sun4i_spdif_remove(struct platform_device *pdev) ...@@ -564,9 +560,6 @@ static int sun4i_spdif_remove(struct platform_device *pdev)
if (!pm_runtime_status_suspended(&pdev->dev)) if (!pm_runtime_status_suspended(&pdev->dev))
sun4i_spdif_runtime_suspend(&pdev->dev); sun4i_spdif_runtime_suspend(&pdev->dev);
snd_soc_unregister_platform(&pdev->dev);
snd_soc_unregister_component(&pdev->dev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment