mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
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: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Ramesh Shanmugasundaram <Ramesh.shanmugasundaram@bp.renesas.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
8a695a6cfa
commit
648f828c1f
1 changed files with 2 additions and 1 deletions
|
@ -274,7 +274,7 @@ static int rcar_drif_alloc_dmachannels(struct rcar_drif_sdr *sdr)
|
|||
{
|
||||
struct dma_slave_config dma_cfg;
|
||||
unsigned int i;
|
||||
int ret = -ENODEV;
|
||||
int ret;
|
||||
|
||||
for_each_rcar_drif_channel(i, &sdr->cur_ch_mask) {
|
||||
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");
|
||||
if (!ch->dmach) {
|
||||
rdrif_err(sdr, "ch%u: dma channel req failed\n", i);
|
||||
ret = -ENODEV;
|
||||
goto dmach_error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue