Commit 65fb3e72 authored by Mark Brown's avatar Mark Brown

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: default avatarStephen Warren <swarren@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 2def2516
...@@ -395,23 +395,9 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) ...@@ -395,23 +395,9 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
ac97->capture_dma_data.maxburst = 4; ac97->capture_dma_data.maxburst = 4;
ac97->capture_dma_data.slave_id = of_dma[0]; ac97->capture_dma_data.slave_id = of_dma[0];
ret = snd_soc_register_component(&pdev->dev, &tegra20_ac97_component,
&tegra20_ac97_dai, 1);
if (ret) {
dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
ret = -ENOMEM;
goto err_clk_put;
}
ret = tegra_pcm_platform_register(&pdev->dev);
if (ret) {
dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
goto err_unregister_component;
}
ret = tegra_asoc_utils_init(&ac97->util_data, &pdev->dev); ret = tegra_asoc_utils_init(&ac97->util_data, &pdev->dev);
if (ret) if (ret)
goto err_unregister_pcm; goto err_clk_put;
ret = tegra_asoc_utils_set_ac97_rate(&ac97->util_data); ret = tegra_asoc_utils_set_ac97_rate(&ac97->util_data);
if (ret) if (ret)
...@@ -423,17 +409,31 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev) ...@@ -423,17 +409,31 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
goto err_asoc_utils_fini; goto err_asoc_utils_fini;
} }
ret = snd_soc_register_component(&pdev->dev, &tegra20_ac97_component,
&tegra20_ac97_dai, 1);
if (ret) {
dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
ret = -ENOMEM;
goto err_asoc_utils_fini;
}
ret = tegra_pcm_platform_register(&pdev->dev);
if (ret) {
dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
goto err_unregister_component;
}
/* XXX: crufty ASoC AC97 API - only one AC97 codec allowed */ /* XXX: crufty ASoC AC97 API - only one AC97 codec allowed */
workdata = ac97; workdata = ac97;
return 0; return 0;
err_asoc_utils_fini:
tegra_asoc_utils_fini(&ac97->util_data);
err_unregister_pcm: err_unregister_pcm:
tegra_pcm_platform_unregister(&pdev->dev); tegra_pcm_platform_unregister(&pdev->dev);
err_unregister_component: err_unregister_component:
snd_soc_unregister_component(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
err_asoc_utils_fini:
tegra_asoc_utils_fini(&ac97->util_data);
err_clk_put: err_clk_put:
err: err:
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment