]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ASoC: atmel: mchp-pdmc: Skip ALSA restoration if substream runtime is uninitialized
authorAndrei Simion <andrei.simion@microchip.com>
Tue, 24 Sep 2024 08:12:38 +0000 (11:12 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:00:10 +0000 (12:00 +0200)
[ Upstream commit 09cfc6a532d249a51d3af5022d37ebbe9c3d31f6 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/atmel/mchp-pdmc.c

index dcc4e14b3dde275551688e9eacb85639b4fbd974..206bbb5aaab5d92779d15bc3382f25476e6c39ae 100644 (file)
@@ -285,6 +285,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;