Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 648f828c authored by Wei Yongjun's avatar Wei Yongjun Committed by Mauro Carvalho Chehab
Browse files

media: rcar_drif: fix error return code in rcar_drif_alloc_dmachannels()



Fix to return error code -ENODEV from the dma_request_slave_channel()
error handling case instead of 0, as done elsewhere in this function.
rc can be overwrite to 0 by dmaengine_slave_config() in the for loop.

Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarRamesh Shanmugasundaram <Ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 8a695a6c
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -274,7 +274,7 @@ static int rcar_drif_alloc_dmachannels(struct rcar_drif_sdr *sdr)
{
{
	struct dma_slave_config dma_cfg;
	struct dma_slave_config dma_cfg;
	unsigned int i;
	unsigned int i;
	int ret = -ENODEV;
	int ret;


	for_each_rcar_drif_channel(i, &sdr->cur_ch_mask) {
	for_each_rcar_drif_channel(i, &sdr->cur_ch_mask) {
		struct rcar_drif *ch = sdr->ch[i];
		struct rcar_drif *ch = sdr->ch[i];
@@ -282,6 +282,7 @@ static int rcar_drif_alloc_dmachannels(struct rcar_drif_sdr *sdr)
		ch->dmach = dma_request_slave_channel(&ch->pdev->dev, "rx");
		ch->dmach = dma_request_slave_channel(&ch->pdev->dev, "rx");
		if (!ch->dmach) {
		if (!ch->dmach) {
			rdrif_err(sdr, "ch%u: dma channel req failed\n", i);
			rdrif_err(sdr, "ch%u: dma channel req failed\n", i);
			ret = -ENODEV;
			goto dmach_error;
			goto dmach_error;
		}
		}