Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1574899 > unrolled thread
| Started by | Wei Yongjun <weiyj.lk@gmail.com> |
|---|---|
| First post | 2017-02-06 16:30 +0100 |
| Last post | 2017-02-06 16:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH -next] ASoC: sun4i-spdif: drop unnessary snd_soc_unregister_component() Wei Yongjun <weiyj.lk@gmail.com> - 2017-02-06 16:30 +0100
Re: [PATCH -next] ASoC: sun4i-spdif: drop unnessary snd_soc_unregister_component() Maxime Ripard <maxime.ripard@free-electrons.com> - 2017-02-06 16:40 +0100
| From | Wei Yongjun <weiyj.lk@gmail.com> |
|---|---|
| Date | 2017-02-06 16:30 +0100 |
| Subject | [PATCH -next] ASoC: sun4i-spdif: drop unnessary snd_soc_unregister_component() |
| Message-ID | <t7ToS-6Gk-7@gated-at.bofh.it> |
From: Wei Yongjun <weiyongjun1@huawei.com>
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: f8260afa444b ("ASoC: sunxi: Add support for the SPDIF block")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
sound/soc/sunxi/sun4i-spdif.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
index c03cd07..eaefd07 100644
--- a/sound/soc/sunxi/sun4i-spdif.c
+++ b/sound/soc/sunxi/sun4i-spdif.c
@@ -510,8 +510,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
host->spdif_clk = devm_clk_get(&pdev->dev, "spdif");
if (IS_ERR(host->spdif_clk)) {
dev_err(&pdev->dev, "failed to get a spdif clock.\n");
- ret = PTR_ERR(host->spdif_clk);
- goto err_disable_apb_clk;
+ return PTR_ERR(host->spdif_clk);
}
host->dma_params_tx.addr = res->start + quirks->reg_dac_txdata;
@@ -525,7 +524,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
if (IS_ERR(host->rst) && PTR_ERR(host->rst) == -EPROBE_DEFER) {
ret = -EPROBE_DEFER;
dev_err(&pdev->dev, "Failed to get reset: %d\n", ret);
- goto err_disable_apb_clk;
+ return ret;
}
if (!IS_ERR(host->rst))
reset_control_deassert(host->rst);
@@ -534,7 +533,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_component(&pdev->dev,
&sun4i_spdif_component, &sun4i_spdif_dai, 1);
if (ret)
- goto err_disable_apb_clk;
+ return ret;
pm_runtime_enable(&pdev->dev);
if (!pm_runtime_enabled(&pdev->dev)) {
@@ -552,9 +551,6 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
sun4i_spdif_runtime_suspend(&pdev->dev);
err_unregister:
pm_runtime_disable(&pdev->dev);
- snd_soc_unregister_component(&pdev->dev);
-err_disable_apb_clk:
- clk_disable_unprepare(host->apb_clk);
return ret;
}
@@ -564,9 +560,6 @@ static int sun4i_spdif_remove(struct platform_device *pdev)
if (!pm_runtime_status_suspended(&pdev->dev))
sun4i_spdif_runtime_suspend(&pdev->dev);
- snd_soc_unregister_platform(&pdev->dev);
- snd_soc_unregister_component(&pdev->dev);
-
return 0;
}
[toc] | [next] | [standalone]
| From | Maxime Ripard <maxime.ripard@free-electrons.com> |
|---|---|
| Date | 2017-02-06 16:40 +0100 |
| Subject | Re: [PATCH -next] ASoC: sun4i-spdif: drop unnessary snd_soc_unregister_component() |
| Message-ID | <t7Tyy-6JX-39@gated-at.bofh.it> |
| In reply to | #1574899 |
[Multipart message — attachments visible in raw view] — view raw
On Mon, Feb 06, 2017 at 03:22:24PM +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> 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: f8260afa444b ("ASoC: sunxi: Add support for the SPDIF block")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web