diff options
author | Nikesh Oswal <noswal@nvidia.com> | 2012-03-14 17:42:56 +0530 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-03-23 13:58:33 -0700 |
commit | 78acd20afb42512133bc9d7a40e43f7cc2bbea75 (patch) | |
tree | 0090729fb74b41fe4cf9630ed5e8db3793491423 | |
parent | 941b25aa5081674617065426f9edd71309846b6c (diff) |
asoc: aic326x machine: handle switch unregistration
If switch registration is success and later card registration
fails then we must unregister the switch
Change-Id: I140b3fb0890f41fea653100bcff450f10294cd9d
Signed-off-by: Nikesh Oswal <noswal@nvidia.com>
Reviewed-on: http://git-master/r/90058
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Scott Peterson <speterson@nvidia.com>
-rw-r--r-- | sound/soc/tegra/tegra_aic326x.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/tegra/tegra_aic326x.c b/sound/soc/tegra/tegra_aic326x.c index 26c5f18d0dc9..b64ab41c97d0 100644 --- a/sound/soc/tegra/tegra_aic326x.c +++ b/sound/soc/tegra/tegra_aic326x.c @@ -884,7 +884,7 @@ static __devinit int tegra_aic326x_driver_probe(struct platform_device *pdev) if (ret) { dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); - goto err_fini_utils; + goto err_switch_unregister; } if (!card->instantiated) { @@ -896,6 +896,10 @@ static __devinit int tegra_aic326x_driver_probe(struct platform_device *pdev) err_unregister_card: snd_soc_unregister_card(card); +err_switch_unregister: +#ifdef CONFIG_SWITCH + switch_dev_unregister(&aic326x_wired_switch_dev); +#endif err_fini_utils: tegra_asoc_utils_fini(&machine->util_data); err_free_machine: |