Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a9b1c61 authored by Boris Brezillon's avatar Boris Brezillon Committed by Mark Brown
Browse files

ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section



clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare)
may sleep and thus cannot be called in critical section.

This patch fix a bug introduced by commit
6f0d9479 where clk_disable_unprepare was
called with user_lock hold.

Signed-off-by: default avatarBoris BREZILLON <b.brezillon@overkiz.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent ad81f054
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -66,14 +66,19 @@ EXPORT_SYMBOL(ssc_request);

void ssc_free(struct ssc_device *ssc)
{
	bool disable_clk = true;

	spin_lock(&user_lock);
	if (ssc->user) {
	if (ssc->user)
		ssc->user--;
		clk_disable_unprepare(ssc->clk);
	} else {
	else {
		disable_clk = false;
		dev_dbg(&ssc->pdev->dev, "device already free\n");
	}
	spin_unlock(&user_lock);

	if (disable_clk)
		clk_disable_unprepare(ssc->clk);
}
EXPORT_SYMBOL(ssc_free);