summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorAndrei Simion <andrei.simion@microchip.com>2024-09-24 10:12:38 +0200
committerMark Brown <broonie@kernel.org>2024-09-24 13:34:28 +0200
commit09cfc6a532d249a51d3af5022d37ebbe9c3d31f6 (patch)
tree0018a9aa4b427a845a5e79b251a82e3c35a0ab1f /sound/soc
parentASoC: cs35l45: Corrects cs35l45_get_clk_freq_id function data type (diff)
downloadlinux-09cfc6a532d249a51d3af5022d37ebbe9c3d31f6.tar.xz
linux-09cfc6a532d249a51d3af5022d37ebbe9c3d31f6.zip
ASoC: atmel: mchp-pdmc: Skip ALSA restoration if substream runtime is uninitialized
Update the driver to prevent alsa-restore.service from failing when reading data from /var/lib/alsa/asound.state at boot. Ensure that the restoration of ALSA mixer configurations is skipped if substream->runtime is NULL. Fixes: 50291652af52 ("ASoC: atmel: mchp-pdmc: add PDMC driver") Signed-off-by: Andrei Simion <andrei.simion@microchip.com> Link: https://patch.msgid.link/20240924081237.50046-1-andrei.simion@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/atmel/mchp-pdmc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/atmel/mchp-pdmc.c b/sound/soc/atmel/mchp-pdmc.c
index 939cd44ebc8a..06dc3c48e7e8 100644
--- a/sound/soc/atmel/mchp-pdmc.c
+++ b/sound/soc/atmel/mchp-pdmc.c
@@ -302,6 +302,9 @@ static int mchp_pdmc_chmap_ctl_put(struct snd_kcontrol *kcontrol,
if (!substream)
return -ENODEV;
+ if (!substream->runtime)
+ return 0; /* just for avoiding error from alsactl restore */
+
map = mchp_pdmc_chmap_get(substream, info);
if (!map)
return -EINVAL;