* [PATCH -next] media: rcar_drif: fix error return code in rcar_drif_alloc_dmachannels()
@ 2018-01-17 11:24 Wei Yongjun
2018-01-17 11:36 ` Sergei Shtylyov
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Wei Yongjun @ 2018-01-17 11:24 UTC (permalink / raw)
To: Ramesh Shanmugasundaram, Mauro Carvalho Chehab
Cc: Wei Yongjun, linux-media, linux-renesas-soc, kernel-janitors
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>
---
drivers/media/platform/rcar_drif.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/rcar_drif.c b/drivers/media/platform/rcar_drif.c
index b2e080e..dc7e280 100644
--- a/drivers/media/platform/rcar_drif.c
+++ b/drivers/media/platform/rcar_drif.c
@@ -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;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next] media: rcar_drif: fix error return code in rcar_drif_alloc_dmachannels()
2018-01-17 11:24 [PATCH -next] media: rcar_drif: fix error return code in rcar_drif_alloc_dmachannels() Wei Yongjun
@ 2018-01-17 11:36 ` Sergei Shtylyov
2018-01-17 12:58 ` Geert Uytterhoeven
2018-01-17 13:46 ` Ramesh Shanmugasundaram
2 siblings, 0 replies; 4+ messages in thread
From: Sergei Shtylyov @ 2018-01-17 11:36 UTC (permalink / raw)
To: Wei Yongjun, Ramesh Shanmugasundaram, Mauro Carvalho Chehab
Cc: linux-media, linux-renesas-soc, kernel-janitors
Hello!
On 01/17/2018 02:24 PM, Wei Yongjun wrote:
> 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.
Overwritten.
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
[...]
MBR, Sergei
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] media: rcar_drif: fix error return code in rcar_drif_alloc_dmachannels()
2018-01-17 11:24 [PATCH -next] media: rcar_drif: fix error return code in rcar_drif_alloc_dmachannels() Wei Yongjun
2018-01-17 11:36 ` Sergei Shtylyov
@ 2018-01-17 12:58 ` Geert Uytterhoeven
2018-01-17 13:46 ` Ramesh Shanmugasundaram
2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2018-01-17 12:58 UTC (permalink / raw)
To: Wei Yongjun
Cc: Ramesh Shanmugasundaram, Mauro Carvalho Chehab,
Linux Media Mailing List, Linux-Renesas, kernel-janitors
On Wed, Jan 17, 2018 at 12:24 PM, Wei Yongjun <weiyongjun1@huawei.com> wrote:
> 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>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH -next] media: rcar_drif: fix error return code in rcar_drif_alloc_dmachannels()
2018-01-17 11:24 [PATCH -next] media: rcar_drif: fix error return code in rcar_drif_alloc_dmachannels() Wei Yongjun
2018-01-17 11:36 ` Sergei Shtylyov
2018-01-17 12:58 ` Geert Uytterhoeven
@ 2018-01-17 13:46 ` Ramesh Shanmugasundaram
2 siblings, 0 replies; 4+ messages in thread
From: Ramesh Shanmugasundaram @ 2018-01-17 13:46 UTC (permalink / raw)
To: Wei Yongjun, Mauro Carvalho Chehab
Cc: linux-media, linux-renesas-soc, kernel-janitors
Hi Wei Yongjun,
Thank you for the patch.
> Subject: [PATCH -next] 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: Ramesh Shanmugasundaram <Ramesh.shanmugasundaram@bp.renesas.com>
Thanks,
Ramesh
> ---
> drivers/media/platform/rcar_drif.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/rcar_drif.c
> b/drivers/media/platform/rcar_drif.c
> index b2e080e..dc7e280 100644
> --- a/drivers/media/platform/rcar_drif.c
> +++ b/drivers/media/platform/rcar_drif.c
> @@ -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;
> }
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-17 13:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-17 11:24 [PATCH -next] media: rcar_drif: fix error return code in rcar_drif_alloc_dmachannels() Wei Yongjun
2018-01-17 11:36 ` Sergei Shtylyov
2018-01-17 12:58 ` Geert Uytterhoeven
2018-01-17 13:46 ` Ramesh Shanmugasundaram
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).