OSDN Git Service

media: stm32-dcmi: Use dma_request_chan() instead dma_request_slave_channel()
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Tue, 7 Jan 2020 11:52:53 +0000 (12:52 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 24 Feb 2020 14:24:52 +0000 (15:24 +0100)
dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.

By using dma_request_chan() directly the driver can support deferred
probing against DMA.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/stm32/stm32-dcmi.c

index 9392e34..b63ff8d 100644 (file)
@@ -1910,10 +1910,13 @@ static int dcmi_probe(struct platform_device *pdev)
                return PTR_ERR(mclk);
        }
 
-       chan = dma_request_slave_channel(&pdev->dev, "tx");
-       if (!chan) {
-               dev_info(&pdev->dev, "Unable to request DMA channel, defer probing\n");
-               return -EPROBE_DEFER;
+       chan = dma_request_chan(&pdev->dev, "tx");
+       if (IS_ERR(chan)) {
+               ret = PTR_ERR(chan);
+               if (ret != -EPROBE_DEFER)
+                       dev_err(&pdev->dev,
+                               "Failed to request DMA channel: %d\n", ret);
+               return ret;
        }
 
        spin_lock_init(&dcmi->irqlock);