ASoC: apple: mca: Adjust timing of component unregister
On removal of the driver, the ASoC component should be unregistered
first, before we start releasing any of the other resources.
Fixes: 3df5d0d972
("ASoC: apple: mca: Start new platform driver")
Signed-off-by: Martin Povišer <povik+lin@cutebit.org>
Link: https://lore.kernel.org/r/20220927113426.49724-3-povik+lin@cutebit.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
e92e50e426
commit
db6ae79a7e
1 changed files with 3 additions and 2 deletions
|
@ -1129,7 +1129,7 @@ static int apple_mca_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = devm_snd_soc_register_component(&pdev->dev, &mca_component,
|
ret = snd_soc_register_component(&pdev->dev, &mca_component,
|
||||||
dai_drivers, nclusters * 2);
|
dai_drivers, nclusters * 2);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&pdev->dev, "unable to register ASoC component: %d\n",
|
dev_err(&pdev->dev, "unable to register ASoC component: %d\n",
|
||||||
|
@ -1148,6 +1148,7 @@ static int apple_mca_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct mca_data *mca = platform_get_drvdata(pdev);
|
struct mca_data *mca = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
|
snd_soc_unregister_component(&pdev->dev);
|
||||||
apple_mca_release(mca);
|
apple_mca_release(mca);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue