Message ID | 20200130070834.17537-1-m.szyprowski@samsung.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] dmaengine: Fix return value for dma_requrest_chan() in case of failure | expand |
Hi Marek, s/dma_requrest_chan/dma_request_chan/ in one-line summary. On Thu, Jan 30, 2020 at 8:08 AM Marek Szyprowski <m.szyprowski@samsung.com> wrote: > 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 <m.szyprowski@samsung.com> Sorry for breaking this, and thanks a lot for your fix! Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Gr{oetje,eeting}s, Geert
On 30-01-20, 08:08, Marek Szyprowski wrote: > 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. Fixed the title and Applied, thanks
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index f3ef4edd4de1..7b1cefc3213a 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;
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 <m.szyprowski@samsung.com> --- drivers/dma/dmaengine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)