From 62e8fcd20e27244fcb532e0de9ef86bb66ae83b1 Mon Sep 17 00:00:00 2001 From: Nikesh Oswal Date: Wed, 14 Mar 2012 17:46:24 +0530 Subject: 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 Reviewed-on: http://git-master/r/90060 Reviewed-by: Simone Willett Tested-by: Simone Willett --- sound/soc/tegra/tegra_max98088.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sound') 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); -- cgit v1.2.3