From 8e83ca8bde2e1c42df08f37840226c9d07d4af69 Mon Sep 17 00:00:00 2001 From: Rhyland Klein Date: Wed, 6 Jun 2012 15:28:40 -0400 Subject: asoc: max98095: probe with no device there fix There is path through which registering a card will fail to probe, but that error code is not propogated back to the tegra machine driver. To catch this case in the machine driver's probe routine, we need to ensure that after registering the card, the card is instantiated and fail probe if not. Change-Id: I64ba952685ef193a3b248502943771c518396808 Signed-off-by: Rhyland Klein Reviewed-on: http://git-master/r/106837 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Scott Peterson --- sound/soc/tegra/tegra_max98095.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/soc/tegra/tegra_max98095.c b/sound/soc/tegra/tegra_max98095.c index b3bed37ac715..701571d23251 100644 --- a/sound/soc/tegra/tegra_max98095.c +++ b/sound/soc/tegra/tegra_max98095.c @@ -658,8 +658,17 @@ static __devinit int tegra_max98095_driver_probe(struct platform_device *pdev) goto err_switch_unregister; } + 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_switch_unregister: #ifdef CONFIG_SWITCH switch_dev_unregister(&wired_switch_dev); -- cgit v1.2.3