Unverified Commit 737ee8bd authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown
Browse files

ASoC: rt700-sdw: use cancel_work_sync() in .remove as well as .suspend



Make sure the workqueues are not running after the .remove() callback,
which can lead to timeout errors.

A previous fix to use cancel_work_sync was applied for the suspend
case but the remove case is missing

Fixes: 5f2df2a4 ('ASoC: rt700: wait for the delayed work to finish when the system suspends')
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@linux.intel.com>
Link: https://lore.kernel.org/r/20210204201739.25206-2-pierre-louis.bossart@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent e681b1a6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -462,8 +462,8 @@ static int rt700_sdw_remove(struct sdw_slave *slave)
	struct rt700_priv *rt700 = dev_get_drvdata(&slave->dev);

	if (rt700 && rt700->hw_init) {
		cancel_delayed_work(&rt700->jack_detect_work);
		cancel_delayed_work(&rt700->jack_btn_check_work);
		cancel_delayed_work_sync(&rt700->jack_detect_work);
		cancel_delayed_work_sync(&rt700->jack_btn_check_work);
	}

	return 0;