[tip:core/locking] ASoC: Don't call DAI registration for CODECs with no DAI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  26b01ccdc8ded270a1a65721b99acacf0c44e088
Gitweb:     http://git.kernel.org/tip/26b01ccdc8ded270a1a65721b99acacf0c44e088
Author:     Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Wed, 18 Aug 2010 20:20:55 +0100
Committer:  Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
CommitDate: Fri, 20 Aug 2010 14:26:45 +0100

ASoC: Don't call DAI registration for CODECs with no DAI

Otherwise we generate worrying (but benign) warnings for amps.

Signed-off-by: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Acked-by: Liam Girdwood <lrg@xxxxxxxxxxxxxxx>
---
 sound/soc/soc-core.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 7093c17..65352c7 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3122,10 +3122,12 @@ int snd_soc_register_codec(struct device *dev,
 		fixup_codec_formats(&dai_drv[i].capture);
 	}
 
-	/* register DAIs */
-	ret = snd_soc_register_dais(dev, dai_drv, num_dai);
-	if (ret < 0)
+	/* register any DAIs */
+	if (num_dai) {
+		ret = snd_soc_register_dais(dev, dai_drv, num_dai);
+		if (ret < 0)
 			goto error;
+	}
 
 	mutex_lock(&client_mutex);
 	list_add(&codec->list, &codec_list);
@@ -3164,8 +3166,9 @@ void snd_soc_unregister_codec(struct device *dev)
 	return;
 
 found:
-	for (i = 0; i < codec->num_dai; i++)
-		snd_soc_unregister_dai(dev);
+	if (codec->num_dai)
+		for (i = 0; i < codec->num_dai; i++)
+			snd_soc_unregister_dai(dev);
 
 	mutex_lock(&client_mutex);
 	list_del(&codec->list);
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux