diff options
author | Xun Zhang <xun2.zhang@intel.com> | 2019-04-19 15:53:49 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-04-25 19:41:58 +0100 |
commit | c46ab1510de1d3dd9871ae36fbec0da3e0d2d6c5 (patch) | |
tree | 9ab380eb7edd01124aaffb8c587960205eeebcba /sound/soc/codecs/rt5682.c | |
parent | 0bbf4084e0cfbbbff8673f3b9867778d5d4b1d6f (diff) | |
download | linux-next-c46ab1510de1d3dd9871ae36fbec0da3e0d2d6c5.tar.gz |
ASoC: codecs: rt5682: initialize mutex before using
In rt5682 codec driver, a mutex called "calibrate_mutex" is used
in rt5682_calibrate() before initialization, which causes warning
in lock debug. Move the initialization before the usage of mutex.
Signed-off-by: Xun Zhang <xun2.zhang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5682.c')
-rw-r--r-- | sound/soc/codecs/rt5682.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c index 86a7fa31c294..505fb3d7b1c5 100644 --- a/sound/soc/codecs/rt5682.c +++ b/sound/soc/codecs/rt5682.c @@ -2588,6 +2588,7 @@ static int rt5682_i2c_probe(struct i2c_client *i2c, rt5682_reset(rt5682->regmap); + mutex_init(&rt5682->calibrate_mutex); rt5682_calibrate(rt5682); ret = regmap_multi_reg_write(rt5682->regmap, patch_list, @@ -2654,7 +2655,6 @@ static int rt5682_i2c_probe(struct i2c_client *i2c, INIT_DELAYED_WORK(&rt5682->jd_check_work, rt5682_jd_check_handler); - mutex_init(&rt5682->calibrate_mutex); if (i2c->irq) { ret = devm_request_threaded_irq(&i2c->dev, i2c->irq, NULL, |