summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWang Ming <machel@vivo.com>2023-07-26 19:51:58 +0800
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-09-27 09:40:01 +0200
commit3f1e1f69ad6c13c9e9fadd0595f7e2ce33ba89a1 (patch)
treed28f8b8fd9d4fc8cb4b281b495dc58b1fd1ecacb
parent026c341795e593df640b901f8d36f90a2461a180 (diff)
media: platform: Use dev_err_probe instead of dev_err
It is possible that dma_request_chan will return EPROBE_DEFER, which means that dma->xdev->dev is not ready yet. In this case, dev_err(dma->xdev->dev), there will be no output. This patch fixes the bug. Signed-off-by: Wang Ming <machel@vivo.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--drivers/media/platform/xilinx/xilinx-dma.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c
index 80d6f5b072ea..a96de5d388a1 100644
--- a/drivers/media/platform/xilinx/xilinx-dma.c
+++ b/drivers/media/platform/xilinx/xilinx-dma.c
@@ -708,9 +708,8 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,
snprintf(name, sizeof(name), "port%u", port);
dma->dma = dma_request_chan(dma->xdev->dev, name);
if (IS_ERR(dma->dma)) {
- ret = PTR_ERR(dma->dma);
- if (ret != -EPROBE_DEFER)
- dev_err(dma->xdev->dev, "no VDMA channel found\n");
+ ret = dev_err_probe(dma->xdev->dev, PTR_ERR(dma->dma),
+ "no VDMA channel found\n");
goto error;
}