Skip to content

Commit fb1847c

Browse files
povikbroonie
authored andcommitted
ASoC: apple: mca: Improve handling of unavailable DMA channels
When we fail to obtain a DMA channel, don't return a blanket -EINVAL, instead return the original error code if there's one. This makes deferring work as it should. Also don't print an error message for -EPROBE_DEFER. Fixes: 4ec8179 ("ASoC: apple: mca: Postpone requesting of DMA channels") Signed-off-by: Martin Povišer <povik+lin@cutebit.org> Link: https://lore.kernel.org/r/20230224153302.45365-3-povik+lin@cutebit.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent d8b3e39 commit fb1847c

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

sound/soc/apple/mca.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,10 +950,17 @@ static int mca_pcm_new(struct snd_soc_component *component,
950950
chan = mca_request_dma_channel(cl, i);
951951

952952
if (IS_ERR_OR_NULL(chan)) {
953+
mca_pcm_free(component, rtd->pcm);
954+
955+
if (chan && PTR_ERR(chan) == -EPROBE_DEFER)
956+
return PTR_ERR(chan);
957+
953958
dev_err(component->dev, "unable to obtain DMA channel (stream %d cluster %d): %pe\n",
954959
i, cl->no, chan);
955-
mca_pcm_free(component, rtd->pcm);
956-
return -EINVAL;
960+
961+
if (!chan)
962+
return -EINVAL;
963+
return PTR_ERR(chan);
957964
}
958965

959966
cl->dma_chans[i] = chan;

0 commit comments

Comments
 (0)