diff --git a/drivers/video/rockchip/rga3/rga_dma_buf.c b/drivers/video/rockchip/rga3/rga_dma_buf.c index 63af3cde8a37..f509fe0977ab 100644 --- a/drivers/video/rockchip/rga3/rga_dma_buf.c +++ b/drivers/video/rockchip/rga3/rga_dma_buf.c @@ -430,15 +430,15 @@ int rga_dma_map_buf(struct dma_buf *dma_buf, struct rga_dma_buffer *rga_dma_buff attach = dma_buf_attach(dma_buf, rga_dev); if (IS_ERR(attach)) { - pr_err("Failed to attach dma_buf\n"); - ret = -EINVAL; + ret = PTR_ERR(attach); + pr_err("Failed to attach dma_buf, ret[%d]\n", ret); goto err_get_attach; } sgt = dma_buf_map_attachment(attach, dir); if (IS_ERR(sgt)) { - pr_err("Failed to map attachment\n"); - ret = -EINVAL; + ret = PTR_ERR(sgt); + pr_err("Failed to map attachment, ret[%d]\n", ret); goto err_get_sgt; } @@ -474,22 +474,22 @@ int rga_dma_map_fd(int fd, struct rga_dma_buffer *rga_dma_buffer, dma_buf = dma_buf_get(fd); if (IS_ERR(dma_buf)) { - pr_err("Fail to get dma_buf from fd[%d]\n", fd); - ret = -EINVAL; + ret = PTR_ERR(dma_buf); + pr_err("Fail to get dma_buf from fd[%d], ret[%d]\n", fd, ret); return ret; } attach = dma_buf_attach(dma_buf, rga_dev); if (IS_ERR(attach)) { - pr_err("Failed to attach dma_buf\n"); - ret = -EINVAL; + ret = PTR_ERR(attach); + pr_err("Failed to attach dma_buf, ret[%d]\n", ret); goto err_get_attach; } sgt = dma_buf_map_attachment(attach, dir); if (IS_ERR(sgt)) { - pr_err("Failed to map attachment\n"); - ret = -EINVAL; + ret = PTR_ERR(sgt); + pr_err("Failed to map attachment, ret[%d]\n", ret); goto err_get_sgt; }