2021-08-17 17:25:03

by Colin King

[permalink] [raw]
Subject: [PATCH][next] iio: adc: Fix -EBUSY timeout error return

From: Colin Ian King <[email protected]>

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 <[email protected]>
---
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


2021-08-18 15:53:30

by Prabhakar Mahadev Lad

[permalink] [raw]
Subject: RE: [PATCH][next] iio: adc: Fix -EBUSY timeout error return

Hi Colin,

Thank you for the patch.

> -----Original Message-----
> From: Colin King <[email protected]>
> Sent: 17 August 2021 18:21
> To: Prabhakar Mahadev Lad <[email protected]>; Jonathan Cameron
> <[email protected]>; Lars-Peter Clausen <[email protected]>; Biju Das <[email protected]>;
> [email protected]; [email protected]
> Cc: [email protected]; [email protected]
> Subject: [PATCH][next] iio: adc: Fix -EBUSY timeout error return
>
> From: Colin Ian King <[email protected]>
>
> 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 <[email protected]>
> ---
> 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 <[email protected]>

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

2021-08-19 17:24:06

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH][next] iio: adc: Fix -EBUSY timeout error return

On Wed, Aug 18, 2021 at 6:51 PM Prabhakar Mahadev Lad
<[email protected]> wrote:

> with the subject changed to above: Reviewed-by: Lad Prabhakar <[email protected]>

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

2021-08-19 17:41:30

by Prabhakar

[permalink] [raw]
Subject: Re: [PATCH][next] iio: adc: Fix -EBUSY timeout error return

On Thu, Aug 19, 2021 at 6:21 PM Andy Shevchenko
<[email protected]> wrote:
>
> On Wed, Aug 18, 2021 at 6:51 PM Prabhakar Mahadev Lad
> <[email protected]> wrote:
>
> > with the subject changed to above: Reviewed-by: Lad Prabhakar <[email protected]>
>
Again with the above fixed:
Reviewed-by: Lad Prabhakar <[email protected]>

> 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

2021-08-29 17:01:45

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH][next] iio: adc: Fix -EBUSY timeout error return

On Thu, 19 Aug 2021 18:39:02 +0100
"Lad, Prabhakar" <[email protected]> wrote:

> On Thu, Aug 19, 2021 at 6:21 PM Andy Shevchenko
> <[email protected]> wrote:
> >
> > On Wed, Aug 18, 2021 at 6:51 PM Prabhakar Mahadev Lad
> > <[email protected]> wrote:
> >
> > > with the subject changed to above: Reviewed-by: Lad Prabhakar <[email protected]>
> >
> Again with the above fixed:
> Reviewed-by: Lad Prabhakar <[email protected]>
>
> > 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