Skip to content

Commit 09cfc6a

Browse files
Andrei Simionbroonie
authored andcommitted
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: 5029165 ("ASoC: atmel: mchp-pdmc: add PDMC driver") Signed-off-by: Andrei Simion <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 01e709a commit 09cfc6a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sound/soc/atmel/mchp-pdmc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ static int mchp_pdmc_chmap_ctl_put(struct snd_kcontrol *kcontrol,
302302
if (!substream)
303303
return -ENODEV;
304304

305+
if (!substream->runtime)
306+
return 0; /* just for avoiding error from alsactl restore */
307+
305308
map = mchp_pdmc_chmap_get(substream, info);
306309
if (!map)
307310
return -EINVAL;

0 commit comments

Comments
 (0)