All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: alsa-devel@alsa-project.org
Cc: tiwai@suse.de,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Rander Wang <rander.wang@intel.com>,
	vkoul@kernel.org, broonie@kernel.org,
	Bard Liao <yung-chuan.liao@linux.intel.com>
Subject: [PATCH 4/7] ASoC: rt711: fix calibrate mutex initialization
Date: Mon,  6 Jun 2022 15:37:49 -0500	[thread overview]
Message-ID: <20220606203752.144159-5-pierre-louis.bossart@linux.intel.com> (raw)
In-Reply-To: <20220606203752.144159-1-pierre-louis.bossart@linux.intel.com>

Follow the same flow as rt711-sdca and initialize all mutexes at probe
time.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
---
 sound/soc/codecs/rt711-sdw.c | 3 +++
 sound/soc/codecs/rt711.c     | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/rt711-sdw.c b/sound/soc/codecs/rt711-sdw.c
index f49c94baa37c6..4fe68bcf2a7c2 100644
--- a/sound/soc/codecs/rt711-sdw.c
+++ b/sound/soc/codecs/rt711-sdw.c
@@ -474,6 +474,9 @@ static int rt711_sdw_remove(struct sdw_slave *slave)
 	if (rt711->first_hw_init)
 		pm_runtime_disable(&slave->dev);
 
+	mutex_destroy(&rt711->calibrate_mutex);
+	mutex_destroy(&rt711->disable_irq_lock);
+
 	return 0;
 }
 
diff --git a/sound/soc/codecs/rt711.c b/sound/soc/codecs/rt711.c
index 9838fb4d5b9c0..1e35ba433a7e7 100644
--- a/sound/soc/codecs/rt711.c
+++ b/sound/soc/codecs/rt711.c
@@ -1204,6 +1204,7 @@ int rt711_init(struct device *dev, struct regmap *sdw_regmap,
 	rt711->sdw_regmap = sdw_regmap;
 	rt711->regmap = regmap;
 
+	mutex_init(&rt711->calibrate_mutex);
 	mutex_init(&rt711->disable_irq_lock);
 
 	/*
@@ -1318,7 +1319,6 @@ int rt711_io_init(struct device *dev, struct sdw_slave *slave)
 			rt711_jack_detect_handler);
 		INIT_DELAYED_WORK(&rt711->jack_btn_check_work,
 			rt711_btn_check_handler);
-		mutex_init(&rt711->calibrate_mutex);
 		INIT_WORK(&rt711->calibration_work, rt711_calibration_work);
 		schedule_work(&rt711->calibration_work);
 	}
-- 
2.34.1


  parent reply	other threads:[~2022-06-06 20:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06 20:37 [PATCH 0/7] ASoC: harden SoundWire codec/machine drivers used on Intel platforms Pierre-Louis Bossart
2022-06-06 20:37 ` [PATCH 1/7] ASoC: Realtek/Maxim SoundWire codecs: disable pm_runtime on remove Pierre-Louis Bossart
2022-06-06 20:37 ` [PATCH 2/7] ASoC: rt711-sdca-sdw: fix calibrate mutex initialization Pierre-Louis Bossart
2022-06-06 20:37 ` [PATCH 3/7] ASoC: Intel: sof_sdw: handle errors on card registration Pierre-Louis Bossart
2022-06-06 20:37 ` Pierre-Louis Bossart [this message]
2022-06-06 20:37 ` [PATCH 5/7] ASoC: rt7*-sdw: harden jack_detect_handler Pierre-Louis Bossart
2022-06-06 20:37 ` [PATCH 6/7] ASoC: codecs: rt700/rt711/rt711-sdca: initialize workqueues in probe Pierre-Louis Bossart
2022-06-06 20:37 ` [PATCH 7/7] ASoC: codecs: rt700/rt711/rt711-sdca: resume bus/codec in .set_jack_detect Pierre-Louis Bossart
2022-06-08 13:35 ` [PATCH 0/7] ASoC: harden SoundWire codec/machine drivers used on Intel platforms Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220606203752.144159-5-pierre-louis.bossart@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=rander.wang@intel.com \
    --cc=tiwai@suse.de \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.