Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: xilinx: Use dma_request_chan() instead dma_request_slave_channel()

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>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Peter Ujfalusi and committed by
Mauro Carvalho Chehab
dea0ab37 ceeb2e61

+6 -5
+6 -5
drivers/media/platform/xilinx/xilinx-dma.c
··· 725 725 726 726 /* ... and the DMA channel. */ 727 727 snprintf(name, sizeof(name), "port%u", port); 728 - dma->dma = dma_request_slave_channel(dma->xdev->dev, name); 729 - if (dma->dma == NULL) { 730 - dev_err(dma->xdev->dev, "no VDMA channel found\n"); 731 - ret = -ENODEV; 728 + dma->dma = dma_request_chan(dma->xdev->dev, name); 729 + if (IS_ERR(dma->dma)) { 730 + ret = PTR_ERR(dma->dma); 731 + if (ret != -EPROBE_DEFER) 732 + dev_err(dma->xdev->dev, "no VDMA channel found\n"); 732 733 goto error; 733 734 } 734 735 ··· 753 752 if (video_is_registered(&dma->video)) 754 753 video_unregister_device(&dma->video); 755 754 756 - if (dma->dma) 755 + if (!IS_ERR_OR_NULL(dma->dma)) 757 756 dma_release_channel(dma->dma); 758 757 759 758 media_entity_cleanup(&dma->video.entity);