提交 474809a2 编写于 作者: M Marek Szyprowski 提交者: Vinod Koul

dmaengine: Fix return value for dma_request_chan() in case of failure

Commit 71723a96 ("dmaengine: Create symlinks between DMA channels and
slaves") changed the dma_request_chan() function flow in such a way that
it always returns EPROBE_DEFER in case of channels that cannot be found.
This break the operation of the devices which have optional DMA channels
as it puts their drivers in endless deferred probe loop. Fix this by
propagating the proper error value.

Fixes: 71723a96 ("dmaengine: Create symlinks between DMA channels and slaves")
Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20200130070834.17537-1-m.szyprowski@samsung.com
[vkoul: fix typo in patch title]
Signed-off-by: NVinod Koul <vkoul@kernel.org>
上级 08607e83
......@@ -759,7 +759,7 @@ struct dma_chan *dma_request_chan(struct device *dev, const char *name)
if (!IS_ERR_OR_NULL(chan))
goto found;
return ERR_PTR(-EPROBE_DEFER);
return chan ? chan : ERR_PTR(-EPROBE_DEFER);
found:
chan->slave = dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册