asoc: tegra: wm8903 machine: Handle card register failure
Manoj Gangwal [Fri, 6 Jan 2012 09:34:49 +0000 (14:34 +0530)]
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>

Rebase-Id: R684a4ef3fa30f3ee3d8cf2809207ecac408d7039

sound/soc/tegra/tegra_wm8903.c

index 5aaa423..4883abd 100644 (file)
@@ -774,8 +774,17 @@ static __devinit int tegra_wm8903_driver_probe(struct platform_device *pdev)
                goto err_fini_utils;
        }
 
+       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_fini_utils:
        tegra_asoc_utils_fini(&machine->util_data);
 err_unregister: