[alsa-devel] [PATCH V2 REPOST] ASoC: dmaengine: support deferred probe for DMA channels
Lars-Peter Clausen
lars at metafoo.de
Tue Dec 10 19:06:41 CET 2013
On 12/10/2013 06:59 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren at nvidia.com>
>
> Enhance dmaengine_pcm_request_chan_of() to support deferred probe for
> DMA channels, by using the new dma_request_slave_channel_or_err() API.
> This prevents snd_dmaengine_pcm_register() from succeeding without
> acquiring DMA channels due to the relevant DMA controller not yet being
> registered.
>
> Signed-off-by: Stephen Warren <swarren at nvidia.com>
> Acked-by: Lars-Peter Clausen <lars at metafoo.de>
Still looks good, but one nitpick:
> - pcm->chan[i] = dma_request_slave_channel(dev, name);
> + chan = dma_request_slave_channel_reason(dev, name);
> + if (IS_ERR(chan)) {
> + if (PTR_ERR(pcm->chan[i]) == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
> + pcm->chan[i] = NULL;
> + } else
> + pcm->chan[i] = chan;
I think checkpatch will complain about the above. There should be brackets
around the else branch.
> if (pcm->flags & SND_DMAENGINE_PCM_FLAG_HALF_DUPLEX)
> break;
> }
>
[...]
More information about the Alsa-devel
mailing list