diff options
author | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2017-11-20 17:14:55 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-11-27 11:41:55 -0500 |
commit | 695b78b548d8a26288f041e907ff17758df9e1d5 (patch) | |
tree | d3d472f33961be79693a03242759862e9cc272ed | |
parent | 4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323 (diff) |
ASoC: fsl_ssi: AC'97 ops need regmap, clock and cleaning up on failure
AC'97 ops (register read / write) need SSI regmap and clock, so they have
to be set after them.
We also need to set these ops back to NULL if we fail the probe.
Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index f2f51e06e22c..c3a83ed0297e 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -1458,12 +1458,6 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
1458 | sizeof(fsl_ssi_ac97_dai)); | 1458 | sizeof(fsl_ssi_ac97_dai)); |
1459 | 1459 | ||
1460 | fsl_ac97_data = ssi_private; | 1460 | fsl_ac97_data = ssi_private; |
1461 | |||
1462 | ret = snd_soc_set_ac97_ops_of_reset(&fsl_ssi_ac97_ops, pdev); | ||
1463 | if (ret) { | ||
1464 | dev_err(&pdev->dev, "could not set AC'97 ops\n"); | ||
1465 | return ret; | ||
1466 | } | ||
1467 | } else { | 1461 | } else { |
1468 | /* Initialize this copy of the CPU DAI driver structure */ | 1462 | /* Initialize this copy of the CPU DAI driver structure */ |
1469 | memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template, | 1463 | memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template, |
@@ -1574,6 +1568,14 @@ static int fsl_ssi_probe(struct platform_device *pdev) | |||
1574 | return ret; | 1568 | return ret; |
1575 | } | 1569 | } |
1576 | 1570 | ||
1571 | if (fsl_ssi_is_ac97(ssi_private)) { | ||
1572 | ret = snd_soc_set_ac97_ops_of_reset(&fsl_ssi_ac97_ops, pdev); | ||
1573 | if (ret) { | ||
1574 | dev_err(&pdev->dev, "could not set AC'97 ops\n"); | ||
1575 | goto error_ac97_ops; | ||
1576 | } | ||
1577 | } | ||
1578 | |||
1577 | ret = devm_snd_soc_register_component(&pdev->dev, &fsl_ssi_component, | 1579 | ret = devm_snd_soc_register_component(&pdev->dev, &fsl_ssi_component, |
1578 | &ssi_private->cpu_dai_drv, 1); | 1580 | &ssi_private->cpu_dai_drv, 1); |
1579 | if (ret) { | 1581 | if (ret) { |
@@ -1657,6 +1659,10 @@ error_sound_card: | |||
1657 | fsl_ssi_debugfs_remove(&ssi_private->dbg_stats); | 1659 | fsl_ssi_debugfs_remove(&ssi_private->dbg_stats); |
1658 | 1660 | ||
1659 | error_asoc_register: | 1661 | error_asoc_register: |
1662 | if (fsl_ssi_is_ac97(ssi_private)) | ||
1663 | snd_soc_set_ac97_ops(NULL); | ||
1664 | |||
1665 | error_ac97_ops: | ||
1660 | if (ssi_private->soc->imx) | 1666 | if (ssi_private->soc->imx) |
1661 | fsl_ssi_imx_clean(pdev, ssi_private); | 1667 | fsl_ssi_imx_clean(pdev, ssi_private); |
1662 | 1668 | ||