Commit 3f1e1f69 authored by Wang Ming's avatar Wang Ming Committed by Hans Verkuil
Browse files

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: default avatarWang Ming <machel@vivo.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 026c3417
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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;
	}