diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2018-07-18 05:29:57 -0400 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2018-07-25 08:34:15 -0400 |
commit | ec8ca8e3b4809bf603814a8834bfd3891e1ccf74 (patch) | |
tree | 61915f2e9f279563d3ff212c8ee4dbdef5edf017 | |
parent | d8095f94e19581057bcad35b8a725aa739e77595 (diff) |
dmaengine: dma_request_chan_by_mask() to handle deferred probing
If there are no DMA devices registered yet, return with EPROBE_DEFER
similarly to the case when requesting a slave channel.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r-- | drivers/dma/dmaengine.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 84ac38dbdb65..504420f213ff 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c | |||
@@ -770,8 +770,14 @@ struct dma_chan *dma_request_chan_by_mask(const dma_cap_mask_t *mask) | |||
770 | return ERR_PTR(-ENODEV); | 770 | return ERR_PTR(-ENODEV); |
771 | 771 | ||
772 | chan = __dma_request_channel(mask, NULL, NULL); | 772 | chan = __dma_request_channel(mask, NULL, NULL); |
773 | if (!chan) | 773 | if (!chan) { |
774 | chan = ERR_PTR(-ENODEV); | 774 | mutex_lock(&dma_list_mutex); |
775 | if (list_empty(&dma_device_list)) | ||
776 | chan = ERR_PTR(-EPROBE_DEFER); | ||
777 | else | ||
778 | chan = ERR_PTR(-ENODEV); | ||
779 | mutex_unlock(&dma_list_mutex); | ||
780 | } | ||
775 | 781 | ||
776 | return chan; | 782 | return chan; |
777 | } | 783 | } |