diff options
-rw-r--r-- | sound/soc/sunxi/sun4i-spdif.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c index c03cd07a9b19..eaefd07a5ed0 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) | |||
510 | host->spdif_clk = devm_clk_get(&pdev->dev, "spdif"); | 510 | host->spdif_clk = devm_clk_get(&pdev->dev, "spdif"); |
511 | if (IS_ERR(host->spdif_clk)) { | 511 | if (IS_ERR(host->spdif_clk)) { |
512 | dev_err(&pdev->dev, "failed to get a spdif clock.\n"); | 512 | dev_err(&pdev->dev, "failed to get a spdif clock.\n"); |
513 | ret = PTR_ERR(host->spdif_clk); | 513 | return PTR_ERR(host->spdif_clk); |
514 | goto err_disable_apb_clk; | ||
515 | } | 514 | } |
516 | 515 | ||
517 | host->dma_params_tx.addr = res->start + quirks->reg_dac_txdata; | 516 | 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 | if (IS_ERR(host->rst) && PTR_ERR(host->rst) == -EPROBE_DEFER) { | 524 | if (IS_ERR(host->rst) && PTR_ERR(host->rst) == -EPROBE_DEFER) { |
526 | ret = -EPROBE_DEFER; | 525 | ret = -EPROBE_DEFER; |
527 | dev_err(&pdev->dev, "Failed to get reset: %d\n", ret); | 526 | dev_err(&pdev->dev, "Failed to get reset: %d\n", ret); |
528 | goto err_disable_apb_clk; | 527 | return ret; |
529 | } | 528 | } |
530 | if (!IS_ERR(host->rst)) | 529 | if (!IS_ERR(host->rst)) |
531 | reset_control_deassert(host->rst); | 530 | reset_control_deassert(host->rst); |
@@ -534,7 +533,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev) | |||
534 | ret = devm_snd_soc_register_component(&pdev->dev, | 533 | ret = devm_snd_soc_register_component(&pdev->dev, |
535 | &sun4i_spdif_component, &sun4i_spdif_dai, 1); | 534 | &sun4i_spdif_component, &sun4i_spdif_dai, 1); |
536 | if (ret) | 535 | if (ret) |
537 | goto err_disable_apb_clk; | 536 | return ret; |
538 | 537 | ||
539 | pm_runtime_enable(&pdev->dev); | 538 | pm_runtime_enable(&pdev->dev); |
540 | if (!pm_runtime_enabled(&pdev->dev)) { | 539 | if (!pm_runtime_enabled(&pdev->dev)) { |
@@ -552,9 +551,6 @@ err_suspend: | |||
552 | sun4i_spdif_runtime_suspend(&pdev->dev); | 551 | sun4i_spdif_runtime_suspend(&pdev->dev); |
553 | err_unregister: | 552 | err_unregister: |
554 | pm_runtime_disable(&pdev->dev); | 553 | pm_runtime_disable(&pdev->dev); |
555 | snd_soc_unregister_component(&pdev->dev); | ||
556 | err_disable_apb_clk: | ||
557 | clk_disable_unprepare(host->apb_clk); | ||
558 | return ret; | 554 | return ret; |
559 | } | 555 | } |
560 | 556 | ||
@@ -564,9 +560,6 @@ static int sun4i_spdif_remove(struct platform_device *pdev) | |||
564 | if (!pm_runtime_status_suspended(&pdev->dev)) | 560 | if (!pm_runtime_status_suspended(&pdev->dev)) |
565 | sun4i_spdif_runtime_suspend(&pdev->dev); | 561 | sun4i_spdif_runtime_suspend(&pdev->dev); |
566 | 562 | ||
567 | snd_soc_unregister_platform(&pdev->dev); | ||
568 | snd_soc_unregister_component(&pdev->dev); | ||
569 | |||
570 | return 0; | 563 | return 0; |
571 | } | 564 | } |
572 | 565 | ||