Skip to content

Commit

Permalink
ASoC: rt5682-sdw: cancel_work_sync() in .remove and .suspend
Browse files Browse the repository at this point in the history
Follow pattern from other drivers and use cancel_work_sync() for both
.remove() and .suspend().

Fixes: 03f6fc6 ('ASoC: rt5682: Add the soundwire support')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Link: https://lore.kernel.org/r/20210204201739.25206-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Pierre-Louis Bossart authored and Mark Brown committed Feb 5, 2021
1 parent 121871a commit c792c36
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/soc/codecs/rt5682-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ static int rt5682_sdw_remove(struct sdw_slave *slave)
struct rt5682_priv *rt5682 = dev_get_drvdata(&slave->dev);

if (rt5682 && rt5682->hw_init)
cancel_delayed_work(&rt5682->jack_detect_work);
cancel_delayed_work_sync(&rt5682->jack_detect_work);

return 0;
}
Expand All @@ -721,6 +721,8 @@ static int __maybe_unused rt5682_dev_suspend(struct device *dev)
if (!rt5682->hw_init)
return 0;

cancel_delayed_work_sync(&rt5682->jack_detect_work);

regcache_cache_only(rt5682->regmap, true);
regcache_mark_dirty(rt5682->regmap);

Expand Down

0 comments on commit c792c36

Please sign in to comment.