diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2018-01-28 21:49:25 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-02-12 06:45:32 -0500 |
commit | 80f23c295b0bb64a65cd19aa5f09104d21bfa165 (patch) | |
tree | c47f7cb3c356897bd09d88ee3fb81d9601c7367b | |
parent | 17d619da7b4e6ee2b5b54a9e3e321679963afa4d (diff) |
ASoC: xtfpga-i2s: replace platform to component
Now platform can be replaced to component, let's do it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/xtensa/xtfpga-i2s.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/sound/soc/xtensa/xtfpga-i2s.c b/sound/soc/xtensa/xtfpga-i2s.c index 2472144b329e..503560916620 100644 --- a/sound/soc/xtensa/xtfpga-i2s.c +++ b/sound/soc/xtensa/xtfpga-i2s.c | |||
@@ -483,13 +483,10 @@ static const struct snd_pcm_ops xtfpga_pcm_ops = { | |||
483 | .pointer = xtfpga_pcm_pointer, | 483 | .pointer = xtfpga_pcm_pointer, |
484 | }; | 484 | }; |
485 | 485 | ||
486 | static const struct snd_soc_platform_driver xtfpga_soc_platform = { | ||
487 | .pcm_new = xtfpga_pcm_new, | ||
488 | .ops = &xtfpga_pcm_ops, | ||
489 | }; | ||
490 | |||
491 | static const struct snd_soc_component_driver xtfpga_i2s_component = { | 486 | static const struct snd_soc_component_driver xtfpga_i2s_component = { |
492 | .name = DRV_NAME, | 487 | .name = DRV_NAME, |
488 | .pcm_new = xtfpga_pcm_new, | ||
489 | .ops = &xtfpga_pcm_ops, | ||
493 | }; | 490 | }; |
494 | 491 | ||
495 | static const struct snd_soc_dai_ops xtfpga_i2s_dai_ops = { | 492 | static const struct snd_soc_dai_ops xtfpga_i2s_dai_ops = { |
@@ -591,18 +588,13 @@ static int xtfpga_i2s_probe(struct platform_device *pdev) | |||
591 | goto err; | 588 | goto err; |
592 | } | 589 | } |
593 | 590 | ||
594 | err = snd_soc_register_platform(&pdev->dev, &xtfpga_soc_platform); | ||
595 | if (err < 0) { | ||
596 | dev_err(&pdev->dev, "couldn't register platform\n"); | ||
597 | goto err; | ||
598 | } | ||
599 | err = devm_snd_soc_register_component(&pdev->dev, | 591 | err = devm_snd_soc_register_component(&pdev->dev, |
600 | &xtfpga_i2s_component, | 592 | &xtfpga_i2s_component, |
601 | xtfpga_i2s_dai, | 593 | xtfpga_i2s_dai, |
602 | ARRAY_SIZE(xtfpga_i2s_dai)); | 594 | ARRAY_SIZE(xtfpga_i2s_dai)); |
603 | if (err < 0) { | 595 | if (err < 0) { |
604 | dev_err(&pdev->dev, "couldn't register component\n"); | 596 | dev_err(&pdev->dev, "couldn't register component\n"); |
605 | goto err_unregister_platform; | 597 | goto err; |
606 | } | 598 | } |
607 | 599 | ||
608 | pm_runtime_enable(&pdev->dev); | 600 | pm_runtime_enable(&pdev->dev); |
@@ -615,8 +607,6 @@ static int xtfpga_i2s_probe(struct platform_device *pdev) | |||
615 | 607 | ||
616 | err_pm_disable: | 608 | err_pm_disable: |
617 | pm_runtime_disable(&pdev->dev); | 609 | pm_runtime_disable(&pdev->dev); |
618 | err_unregister_platform: | ||
619 | snd_soc_unregister_platform(&pdev->dev); | ||
620 | err: | 610 | err: |
621 | dev_err(&pdev->dev, "%s: err = %d\n", __func__, err); | 611 | dev_err(&pdev->dev, "%s: err = %d\n", __func__, err); |
622 | return err; | 612 | return err; |
@@ -626,7 +616,6 @@ static int xtfpga_i2s_remove(struct platform_device *pdev) | |||
626 | { | 616 | { |
627 | struct xtfpga_i2s *i2s = dev_get_drvdata(&pdev->dev); | 617 | struct xtfpga_i2s *i2s = dev_get_drvdata(&pdev->dev); |
628 | 618 | ||
629 | snd_soc_unregister_platform(&pdev->dev); | ||
630 | if (i2s->regmap && !IS_ERR(i2s->regmap)) { | 619 | if (i2s->regmap && !IS_ERR(i2s->regmap)) { |
631 | regmap_write(i2s->regmap, XTFPGA_I2S_CONFIG, 0); | 620 | regmap_write(i2s->regmap, XTFPGA_I2S_CONFIG, 0); |
632 | regmap_write(i2s->regmap, XTFPGA_I2S_INT_MASK, 0); | 621 | regmap_write(i2s->regmap, XTFPGA_I2S_INT_MASK, 0); |