summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorNikesh Oswal <noswal@nvidia.com>2012-03-14 17:46:24 +0530
committerSimone Willett <swillett@nvidia.com>2012-03-23 14:00:48 -0700
commit62e8fcd20e27244fcb532e0de9ef86bb66ae83b1 (patch)
treea326bae52933e2b3d5606c7f49ae8e2269ede069 /sound/soc
parentf6077df65f1f42d69a2e278076218ae66dfa436c (diff)
asoc: tegra: max98088 machine: check for card instantiation
If card fails to instantiate then unregister the card Change-Id: Ibcc0d505a8df48c1f924a3d8688dc23e362d5e8d Signed-off-by: Nikesh Oswal <noswal@nvidia.com> Reviewed-on: http://git-master/r/90060 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/tegra/tegra_max98088.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/tegra/tegra_max98088.c b/sound/soc/tegra/tegra_max98088.c
index 1a4650104c7a..7f17667f41ac 100644
--- a/sound/soc/tegra/tegra_max98088.c
+++ b/sound/soc/tegra/tegra_max98088.c
@@ -1157,8 +1157,15 @@ static __devinit int tegra_max98088_driver_probe(struct platform_device *pdev)
goto err_switch_unregister;
}
+ if (!card->instantiated) {
+ dev_err(&pdev->dev, "No MAX98088 codec\n");
+ goto err_unregister_card;
+ }
+
return 0;
+err_unregister_card:
+ snd_soc_unregister_card(card);
err_switch_unregister:
#ifdef CONFIG_SWITCH
switch_dev_unregister(&wired_switch_dev);