[alsa-devel] [PATCH 3/3] ASoC: rsnd: call snd_soc_card_disconnect_sync() when remove

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Wed Oct 11 08:37:29 CEST 2017


From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>

Renesas R-Car sound driver should be stopped when unbind during
playbacking/capturing. Otherwise clock open/close counter mismatch
happen.

One note is that we can't skip from remove function (= return -Exxx)
in such case if user used unbind. Because unbind function doesn't
check return value from each driver's remove function.
This means we must to stop and remove driver in remove function.

Now ASoC has snd_soc_card_disconnect_sync() for this purpose.
Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
 sound/soc/sh/rcar/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index 15f0929..77003a7 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -1500,6 +1500,8 @@ static int rsnd_remove(struct platform_device *pdev)
 		ret |= rsnd_dai_call(remove, &rdai->capture, priv);
 	}
 
+	snd_soc_card_disconnect_sync(&pdev->dev);
+
 	for (i = 0; i < ARRAY_SIZE(remove_func); i++)
 		remove_func[i](priv);
 
-- 
1.9.1



More information about the Alsa-devel mailing list