diff options
author | Rhyland Klein <rklein@nvidia.com> | 2012-06-06 15:28:40 -0400 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-06-11 17:31:49 -0700 |
commit | 8e83ca8bde2e1c42df08f37840226c9d07d4af69 (patch) | |
tree | 7eaed6ece90ac389a41c98f136acb449a7cb2739 /sound | |
parent | b901b56e0c0573ce30393836e4078ca78beffca0 (diff) |
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 <rklein@nvidia.com>
Reviewed-on: http://git-master/r/106837
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/tegra/tegra_max98095.c | 9 |
1 files changed, 9 insertions, 0 deletions
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); |