Skip to content

Commit

Permalink
ASoC: fsl_ssi: add AC'97 ops setting check and cleanup
Browse files Browse the repository at this point in the history
Check whether setting AC'97 ops succeeded and clean them
on removal so the fsl_ssi driver can be reloaded.

Signed-off-by: Maciej Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Maciej S. Szmigiero authored and Mark Brown committed Aug 14, 2015
1 parent 06cb373 commit 04143d6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sound/soc/fsl/fsl_ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,11 @@ static int fsl_ssi_probe(struct platform_device *pdev)

fsl_ac97_data = ssi_private;

snd_soc_set_ac97_ops_of_reset(&fsl_ssi_ac97_ops, pdev);
ret = snd_soc_set_ac97_ops_of_reset(&fsl_ssi_ac97_ops, pdev);
if (ret) {
dev_err(&pdev->dev, "could not set AC'97 ops\n");
return ret;
}
} else {
/* Initialize this copy of the CPU DAI driver structure */
memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template,
Expand Down Expand Up @@ -1480,6 +1484,9 @@ static int fsl_ssi_remove(struct platform_device *pdev)
if (ssi_private->soc->imx)
fsl_ssi_imx_clean(pdev, ssi_private);

if (fsl_ssi_is_ac97(ssi_private))
snd_soc_set_ac97_ops(NULL);

return 0;
}

Expand Down

0 comments on commit 04143d6

Please sign in to comment.