]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
media: pxa_camera: Use dma_request_chan() instead dma_request_slave_channel()
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Tue, 17 Dec 2019 10:39:23 +0000 (11:39 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 24 Feb 2020 15:04:23 +0000 (16:04 +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>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/pxa_camera.c

index 43ae645d866b880d0ef3a907a81664dab6bceffb..321dee9ca81cb01dd15e862fd5d7982fc8c4ca01 100644 (file)
@@ -2440,23 +2440,23 @@ static int pxa_camera_probe(struct platform_device *pdev)
        pcdev->base = base;
 
        /* request dma */
-       pcdev->dma_chans[0] = dma_request_slave_channel(&pdev->dev, "CI_Y");
-       if (!pcdev->dma_chans[0]) {
+       pcdev->dma_chans[0] = dma_request_chan(&pdev->dev, "CI_Y");
+       if (IS_ERR(pcdev->dma_chans[0])) {
                dev_err(&pdev->dev, "Can't request DMA for Y\n");
-               return -ENODEV;
+               return PTR_ERR(pcdev->dma_chans[0]);
        }
 
-       pcdev->dma_chans[1] = dma_request_slave_channel(&pdev->dev, "CI_U");
-       if (!pcdev->dma_chans[1]) {
-               dev_err(&pdev->dev, "Can't request DMA for Y\n");
-               err = -ENODEV;
+       pcdev->dma_chans[1] = dma_request_chan(&pdev->dev, "CI_U");
+       if (IS_ERR(pcdev->dma_chans[1])) {
+               dev_err(&pdev->dev, "Can't request DMA for U\n");
+               err = PTR_ERR(pcdev->dma_chans[1]);
                goto exit_free_dma_y;
        }
 
-       pcdev->dma_chans[2] = dma_request_slave_channel(&pdev->dev, "CI_V");
-       if (!pcdev->dma_chans[2]) {
+       pcdev->dma_chans[2] = dma_request_chan(&pdev->dev, "CI_V");
+       if (IS_ERR(pcdev->dma_chans[2])) {
                dev_err(&pdev->dev, "Can't request DMA for V\n");
-               err = -ENODEV;
+               err = PTR_ERR(pcdev->dma_chans[2]);
                goto exit_free_dma_u;
        }