ASoC: codecs: max98373-sdw: add missing test on resume
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 21 Aug 2020 19:55:54 +0000 (14:55 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 24 Aug 2020 12:41:30 +0000 (13:41 +0100)
All existing SoundWire codecs follow the same pattern on resume,
except for this codec which doesn't test if the hardware is
initialized.

Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200821195603.215535-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/max98373-sdw.c

index 5fe7247..6469612 100644 (file)
@@ -256,6 +256,9 @@ static __maybe_unused int max98373_resume(struct device *dev)
        struct max98373_priv *max98373 = dev_get_drvdata(dev);
        unsigned long time;
 
+       if (!max98373->hw_init)
+               return 0;
+
        if (!slave->unattach_request)
                goto regmap_sync;