From: Marek Szyprowski Date: Thu, 30 Jan 2020 07:08:34 +0000 (+0100) Subject: dmaengine: Fix return value for dma_request_chan() in case of failure X-Git-Tag: v5.10.7~3284^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=474809a28e7b0671a5090de6e0db91f0e3821360;p=platform%2Fkernel%2Flinux-rpi.git dmaengine: Fix return value for dma_request_chan() in case of failure Commit 71723a96b8b1 ("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: 71723a96b8b1 ("dmaengine: Create symlinks between DMA channels and slaves") Signed-off-by: Marek Szyprowski Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20200130070834.17537-1-m.szyprowski@samsung.com [vkoul: fix typo in patch title] Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index f3ef4ed..7b1cefc 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -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;