kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] iio: adc: Fix -EBUSY timeout error return
@ 2021-08-17 17:21 Colin King
  2021-08-18 15:50 ` Prabhakar Mahadev Lad
  0 siblings, 1 reply; 5+ messages in thread
From: Colin King @ 2021-08-17 17:21 UTC (permalink / raw)
  To: Lad Prabhakar, Jonathan Cameron, Lars-Peter Clausen, Biju Das,
	linux-iio, linux-renesas-soc
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently when a timeout occurs in rzg2l_adc_hw_init the error -EBUSY is
assigned to ret but the error code is used as the function is hard-coded
to return 0.  The variable ret is 0 before entering the while-loop hence
the fix is just to return ret at the end of the function to return the
success 0 or -EBUSY return code.

Addresses-Coverity: ("Unused value")
Fixes: d484c21bacfa ("iio: adc: Add driver for Renesas RZ/G2L A/D converter")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/iio/adc/rzg2l_adc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/rzg2l_adc.c b/drivers/iio/adc/rzg2l_adc.c
index 9996d5eef289..868b183e75ea 100644
--- a/drivers/iio/adc/rzg2l_adc.c
+++ b/drivers/iio/adc/rzg2l_adc.c
@@ -401,7 +401,7 @@ static int rzg2l_adc_hw_init(struct rzg2l_adc *adc)
 exit_hw_init:
 	clk_disable_unprepare(adc->pclk);
 
-	return 0;
+	return ret;
 }
 
 static void rzg2l_adc_pm_runtime_disable(void *data)
-- 
2.32.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH][next] iio: adc: Fix -EBUSY timeout error return
  2021-08-17 17:21 [PATCH][next] iio: adc: Fix -EBUSY timeout error return Colin King
@ 2021-08-18 15:50 ` Prabhakar Mahadev Lad
  2021-08-19 17:20   ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Prabhakar Mahadev Lad @ 2021-08-18 15:50 UTC (permalink / raw)
  To: Colin King, Jonathan Cameron, Lars-Peter Clausen, Biju Das,
	linux-iio, linux-renesas-soc
  Cc: kernel-janitors, linux-kernel

Hi Colin,

Thank you for the patch.

> -----Original Message-----
> From: Colin King <colin.king@canonical.com>
> Sent: 17 August 2021 18:21
> To: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>; Jonathan Cameron
> <jic23@kernel.org>; Lars-Peter Clausen <lars@metafoo.de>; Biju Das <biju.das.jz@bp.renesas.com>;
> linux-iio@vger.kernel.org; linux-renesas-soc@vger.kernel.org
> Cc: kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH][next] iio: adc: Fix -EBUSY timeout error return
> 
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently when a timeout occurs in rzg2l_adc_hw_init the error -EBUSY is assigned to ret but the error
> code is used as the function is hard-coded to return 0.  The variable ret is 0 before entering the
> while-loop hence the fix is just to return ret at the end of the function to return the success 0 or -
> EBUSY return code.
> 
> Addresses-Coverity: ("Unused value")
> Fixes: d484c21bacfa ("iio: adc: Add driver for Renesas RZ/G2L A/D converter")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/iio/adc/rzg2l_adc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
iio: adc: rzg2l_adc: Fix -EBUSY timeout error return

with the subject changed to above: Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Cheers,
Prabhakar

> diff --git a/drivers/iio/adc/rzg2l_adc.c b/drivers/iio/adc/rzg2l_adc.c index
> 9996d5eef289..868b183e75ea 100644
> --- a/drivers/iio/adc/rzg2l_adc.c
> +++ b/drivers/iio/adc/rzg2l_adc.c
> @@ -401,7 +401,7 @@ static int rzg2l_adc_hw_init(struct rzg2l_adc *adc)
>  exit_hw_init:
>  	clk_disable_unprepare(adc->pclk);
> 
> -	return 0;
> +	return ret;
>  }
> 
>  static void rzg2l_adc_pm_runtime_disable(void *data)
> --
> 2.32.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][next] iio: adc: Fix -EBUSY timeout error return
  2021-08-18 15:50 ` Prabhakar Mahadev Lad
@ 2021-08-19 17:20   ` Andy Shevchenko
  2021-08-19 17:39     ` Lad, Prabhakar
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2021-08-19 17:20 UTC (permalink / raw)
  To: Prabhakar Mahadev Lad
  Cc: Colin King, Jonathan Cameron, Lars-Peter Clausen, Biju Das,
	linux-iio, linux-renesas-soc, kernel-janitors, linux-kernel

On Wed, Aug 18, 2021 at 6:51 PM Prabhakar Mahadev Lad
<prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:

> with the subject changed to above: Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Always put your tags in a single tag per single line. This will allow
tools to catch them up automatically.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][next] iio: adc: Fix -EBUSY timeout error return
  2021-08-19 17:20   ` Andy Shevchenko
@ 2021-08-19 17:39     ` Lad, Prabhakar
  2021-08-29 17:01       ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: Lad, Prabhakar @ 2021-08-19 17:39 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Prabhakar Mahadev Lad, Colin King, Jonathan Cameron,
	Lars-Peter Clausen, Biju Das, linux-iio, linux-renesas-soc,
	kernel-janitors, linux-kernel

On Thu, Aug 19, 2021 at 6:21 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Wed, Aug 18, 2021 at 6:51 PM Prabhakar Mahadev Lad
> <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
>
> > with the subject changed to above: Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
Again with the above fixed:
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

> Always put your tags in a single tag per single line. This will allow
> tools to catch them up automatically.
>
My bad, fixed that now.

Cheers,
Prabhakar

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][next] iio: adc: Fix -EBUSY timeout error return
  2021-08-19 17:39     ` Lad, Prabhakar
@ 2021-08-29 17:01       ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2021-08-29 17:01 UTC (permalink / raw)
  To: Lad, Prabhakar
  Cc: Andy Shevchenko, Prabhakar Mahadev Lad, Colin King,
	Lars-Peter Clausen, Biju Das, linux-iio, linux-renesas-soc,
	kernel-janitors, linux-kernel

On Thu, 19 Aug 2021 18:39:02 +0100
"Lad, Prabhakar" <prabhakar.csengg@gmail.com> wrote:

> On Thu, Aug 19, 2021 at 6:21 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> >
> > On Wed, Aug 18, 2021 at 6:51 PM Prabhakar Mahadev Lad
> > <prabhakar.mahadev-lad.rj@bp.renesas.com> wrote:
> >  
> > > with the subject changed to above: Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>  
> >  
> Again with the above fixed:
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> 
> > Always put your tags in a single tag per single line. This will allow
> > tools to catch them up automatically.
> >  
> My bad, fixed that now.

Tweaked patch name as suggested and applied to the fixes-togreg branch of iio.git

Too late to sneak this in pre merge window, so I'll do it after rc1.

Thanks,

Jonathan

> 
> Cheers,
> Prabhakar


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-29 16:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 17:21 [PATCH][next] iio: adc: Fix -EBUSY timeout error return Colin King
2021-08-18 15:50 ` Prabhakar Mahadev Lad
2021-08-19 17:20   ` Andy Shevchenko
2021-08-19 17:39     ` Lad, Prabhakar
2021-08-29 17:01       ` Jonathan Cameron

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).