summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorManoj Gangwal <mgangwal@nvidia.com>2012-01-06 15:04:49 +0530
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-01-10 08:22:06 -0800
commita7aeec896f5856c548954f62b7cd298292c6d5d5 (patch)
tree2a638223406dd05408e00b373ceb8a6153759916 /sound
parentb577a4822b263dcddd34390a0d3340c759ab2370 (diff)
asoc: tegra: wm8903 machine: Handle card register failure
Add the support for handling the wm8903 sound card registration failure error. Bug 910788 Change-Id: Ib25f9ca4dd7f5ebd417700421625eb2f3bdc7b5e Signed-off-by: Manoj Gangwal <mgangwal@nvidia.com> Reviewed-on: http://git-master/r/73694 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sumit Bhattacharya <sumitb@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> (cherry picked from commit 505788de21a98bbc651a536a56f6594fa589252e) Reviewed-on: http://git-master/r/73963 Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Tested-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/tegra/tegra_wm8903.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c
index 67cb126876f7..bdd355574066 100644
--- a/sound/soc/tegra/tegra_wm8903.c
+++ b/sound/soc/tegra/tegra_wm8903.c
@@ -796,8 +796,17 @@ static __devinit int tegra_wm8903_driver_probe(struct platform_device *pdev)
goto err_unregister_switch;
}
+ if (!card->instantiated) {
+ ret = -ENODEV;
+ dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
+ ret);
+ goto err_unregister_card;
+ }
+
return 0;
+err_unregister_card:
+ snd_soc_unregister_card(card);
err_unregister_switch:
#ifdef CONFIG_SWITCH
switch_dev_unregister(&tegra_wm8903_headset_switch);