ASoC: rt711: fix calibrate mutex initialization
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Mon, 6 Jun 2022 20:37:49 +0000 (15:37 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 7 Jun 2022 19:37:29 +0000 (20:37 +0100)
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>
Link: https://lore.kernel.org/r/20220606203752.144159-5-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt711-sdw.c
sound/soc/codecs/rt711.c

index f49c94b..4fe68bc 100644 (file)
@@ -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;
 }
 
index 9838fb4..1e35ba4 100644 (file)
@@ -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);
        }