summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 3c087b478398..3754a08baf62 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -975,17 +975,15 @@ static void soc_remove_dai(struct snd_soc_dai *dai, int order)
dai->probed = 0;
}
+static void soc_rtd_free(struct snd_soc_pcm_runtime *rtd); /* remove me */
static void soc_remove_link_dais(struct snd_soc_card *card,
struct snd_soc_pcm_runtime *rtd, int order)
{
int i;
struct snd_soc_dai *codec_dai;
- /* unregister the rtd device */
- if (rtd->dev_registered) {
- device_unregister(rtd->dev);
- rtd->dev_registered = 0;
- }
+ /* finalize rtd device */
+ soc_rtd_free(rtd);
/* remove the CODEC DAI */
for_each_rtd_codec_dai(rtd, i, codec_dai)
@@ -1340,6 +1338,15 @@ err_probe:
return ret;
}
+static void soc_rtd_free(struct snd_soc_pcm_runtime *rtd)
+{
+ if (rtd->dev_registered) {
+ /* we don't need to call kfree() for rtd->dev */
+ device_unregister(rtd->dev);
+ rtd->dev_registered = 0;
+ }
+}
+
static void soc_rtd_release(struct device *dev)
{
kfree(dev);