From 78acd20afb42512133bc9d7a40e43f7cc2bbea75 Mon Sep 17 00:00:00 2001 From: Nikesh Oswal Date: Wed, 14 Mar 2012 17:42:56 +0530 Subject: 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 Reviewed-on: http://git-master/r/90058 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Scott Peterson --- sound/soc/tegra/tegra_aic326x.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sound') 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: -- cgit v1.2.3