diff options
author | Mark Brown <broonie@linaro.org> | 2013-06-26 07:27:58 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-06-27 04:45:14 -0400 |
commit | 65fb3e726c5b21f0c4b76e69d8e1dae961ae74e8 (patch) | |
tree | 535781b3719f78b613e66f0f06dc99e335f41bbf /sound/soc/tegra | |
parent | 2def2516aad75d73e899ee952754a89774d5b935 (diff) |
ASoC: tegra-ac97: Do common and clock init prior to component registration
Otherwise we may instantiate and hence have something try to access the
device while it is still completing initialisation.
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/tegra')
-rw-r--r-- | sound/soc/tegra/tegra20_ac97.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c index 9043626da6fa..48037f784a86 100644 --- a/sound/soc/tegra/tegra20_ac97.c +++ b/sound/soc/tegra/tegra20_ac97.c | |||
@@ -395,23 +395,9 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) | |||
395 | ac97->capture_dma_data.maxburst = 4; | 395 | ac97->capture_dma_data.maxburst = 4; |
396 | ac97->capture_dma_data.slave_id = of_dma[0]; | 396 | ac97->capture_dma_data.slave_id = of_dma[0]; |
397 | 397 | ||
398 | ret = snd_soc_register_component(&pdev->dev, &tegra20_ac97_component, | ||
399 | &tegra20_ac97_dai, 1); | ||
400 | if (ret) { | ||
401 | dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); | ||
402 | ret = -ENOMEM; | ||
403 | goto err_clk_put; | ||
404 | } | ||
405 | |||
406 | ret = tegra_pcm_platform_register(&pdev->dev); | ||
407 | if (ret) { | ||
408 | dev_err(&pdev->dev, "Could not register PCM: %d\n", ret); | ||
409 | goto err_unregister_component; | ||
410 | } | ||
411 | |||
412 | ret = tegra_asoc_utils_init(&ac97->util_data, &pdev->dev); | 398 | ret = tegra_asoc_utils_init(&ac97->util_data, &pdev->dev); |
413 | if (ret) | 399 | if (ret) |
414 | goto err_unregister_pcm; | 400 | goto err_clk_put; |
415 | 401 | ||
416 | ret = tegra_asoc_utils_set_ac97_rate(&ac97->util_data); | 402 | ret = tegra_asoc_utils_set_ac97_rate(&ac97->util_data); |
417 | if (ret) | 403 | if (ret) |
@@ -423,17 +409,31 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) | |||
423 | goto err_asoc_utils_fini; | 409 | goto err_asoc_utils_fini; |
424 | } | 410 | } |
425 | 411 | ||
412 | ret = snd_soc_register_component(&pdev->dev, &tegra20_ac97_component, | ||
413 | &tegra20_ac97_dai, 1); | ||
414 | if (ret) { | ||
415 | dev_err(&pdev->dev, "Could not register DAI: %d\n", ret); | ||
416 | ret = -ENOMEM; | ||
417 | goto err_asoc_utils_fini; | ||
418 | } | ||
419 | |||
420 | ret = tegra_pcm_platform_register(&pdev->dev); | ||
421 | if (ret) { | ||
422 | dev_err(&pdev->dev, "Could not register PCM: %d\n", ret); | ||
423 | goto err_unregister_component; | ||
424 | } | ||
425 | |||
426 | /* XXX: crufty ASoC AC97 API - only one AC97 codec allowed */ | 426 | /* XXX: crufty ASoC AC97 API - only one AC97 codec allowed */ |
427 | workdata = ac97; | 427 | workdata = ac97; |
428 | 428 | ||
429 | return 0; | 429 | return 0; |
430 | 430 | ||
431 | err_asoc_utils_fini: | ||
432 | tegra_asoc_utils_fini(&ac97->util_data); | ||
433 | err_unregister_pcm: | 431 | err_unregister_pcm: |
434 | tegra_pcm_platform_unregister(&pdev->dev); | 432 | tegra_pcm_platform_unregister(&pdev->dev); |
435 | err_unregister_component: | 433 | err_unregister_component: |
436 | snd_soc_unregister_component(&pdev->dev); | 434 | snd_soc_unregister_component(&pdev->dev); |
435 | err_asoc_utils_fini: | ||
436 | tegra_asoc_utils_fini(&ac97->util_data); | ||
437 | err_clk_put: | 437 | err_clk_put: |
438 | err: | 438 | err: |
439 | return ret; | 439 | return ret; |