10 Dec
2013
10 Dec
'13
8:06 p.m.
On 12/10/2013 06:59 PM, Stephen Warren wrote:
From: Stephen Warren swarren@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@nvidia.com Acked-by: Lars-Peter Clausen lars@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;
}
[...]