public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: ade9000: fix wrong return type in streaming push
@ 2026-02-24 12:59 Giorgi Tchankvetadze
  2026-02-24 13:09 ` Miclaus, Antoniu
  2026-02-24 13:23 ` [PATCH v2] " Giorgi Tchankvetadze
  0 siblings, 2 replies; 6+ messages in thread
From: Giorgi Tchankvetadze @ 2026-02-24 12:59 UTC (permalink / raw)
  To: antoniu.miclaus, lars, Michael.Hennerich, jic23
  Cc: dlechner, nuno.sa, andy, linux-iio, linux-kernel,
	Giorgi Tchankvetadze

The else branch of ade9000_iio_push_streaming() incorrectly returns
IRQ_HANDLED on regmap_write failure. This function returns int (0 on
success, negative errno on failure), so IRQ_HANDLED (1) would be
misinterpreted as a non-error by callers.

Return ret instead, consistent with every other error path in the
function. Also add the missing newline in the error message.

Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
---
 drivers/iio/adc/ade9000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
index 5dcc26a08970..07e84c6257d4 100644
--- a/drivers/iio/adc/ade9000.c
+++ b/drivers/iio/adc/ade9000.c
@@ -786,8 +786,8 @@ static int ade9000_iio_push_streaming(struct iio_dev *indio_dev)
 		ret = regmap_write(st->regmap, ADE9000_REG_WFB_PG_IRQEN,
 				   ADE9000_MIDDLE_PAGE_BIT);
 		if (ret) {
-			dev_err_ratelimited(dev, "IRQ0 WFB write fail");
-			return IRQ_HANDLED;
+			dev_err_ratelimited(dev, "IRQ0 WFB write fail\n");
+			return ret;
 		}
 
 		ade9000_configure_scan(indio_dev, ADE9000_REG_WF_BUFF);
-- 
2.52.0


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

* RE: [PATCH] iio: adc: ade9000: fix wrong return type in streaming push
  2026-02-24 12:59 [PATCH] iio: adc: ade9000: fix wrong return type in streaming push Giorgi Tchankvetadze
@ 2026-02-24 13:09 ` Miclaus, Antoniu
  2026-02-24 14:49   ` Andy Shevchenko
  2026-02-24 13:23 ` [PATCH v2] " Giorgi Tchankvetadze
  1 sibling, 1 reply; 6+ messages in thread
From: Miclaus, Antoniu @ 2026-02-24 13:09 UTC (permalink / raw)
  To: Giorgi Tchankvetadze, lars@metafoo.de, Hennerich, Michael,
	jic23@kernel.org
  Cc: David Lechner, Sa, Nuno, andy@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org

> -----Original Message-----
> From: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
> Sent: Tuesday, February 24, 2026 2:59 PM
> To: Miclaus, Antoniu <Antoniu.Miclaus@analog.com>; lars@metafoo.de;
> Hennerich, Michael <Michael.Hennerich@analog.com>; jic23@kernel.org
> Cc: David Lechner <dlechner@baylibre.com>; Sa, Nuno
> <Nuno.Sa@analog.com>; andy@kernel.org; linux-iio@vger.kernel.org; linux-
> kernel@vger.kernel.org; Giorgi Tchankvetadze
> <giorgitchankvetadze1997@gmail.com>
> Subject: [PATCH] iio: adc: ade9000: fix wrong return type in streaming push
> 
> [External]
> 
> The else branch of ade9000_iio_push_streaming() incorrectly returns
> IRQ_HANDLED on regmap_write failure. This function returns int (0 on
> success, negative errno on failure), so IRQ_HANDLED (1) would be
> misinterpreted as a non-error by callers.
> 
> Return ret instead, consistent with every other error path in the
> function. Also add the missing newline in the error message.
> 
> Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
> ---

Hi,

>  drivers/iio/adc/ade9000.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
> index 5dcc26a08970..07e84c6257d4 100644
> --- a/drivers/iio/adc/ade9000.c
> +++ b/drivers/iio/adc/ade9000.c
> @@ -786,8 +786,8 @@ static int ade9000_iio_push_streaming(struct iio_dev
> *indio_dev)
>  		ret = regmap_write(st->regmap,
> ADE9000_REG_WFB_PG_IRQEN,
>  				   ADE9000_MIDDLE_PAGE_BIT);
>  		if (ret) {
> -			dev_err_ratelimited(dev, "IRQ0 WFB write fail");
> -			return IRQ_HANDLED;
> +			dev_err_ratelimited(dev, "IRQ0 WFB write fail\n");

The `\n` is unrelated to the scope of this patch. Also, you are missing a Fixes: tag.

Otherwise, the fix looks good.

> +			return ret;
>  		}
> 
>  		ade9000_configure_scan(indio_dev,
> ADE9000_REG_WF_BUFF);
> --
> 2.52.0


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

* [PATCH v2] iio: adc: ade9000: fix wrong return type in streaming push
  2026-02-24 12:59 [PATCH] iio: adc: ade9000: fix wrong return type in streaming push Giorgi Tchankvetadze
  2026-02-24 13:09 ` Miclaus, Antoniu
@ 2026-02-24 13:23 ` Giorgi Tchankvetadze
  2026-02-24 13:30   ` Miclaus, Antoniu
  2026-02-24 14:47   ` Andy Shevchenko
  1 sibling, 2 replies; 6+ messages in thread
From: Giorgi Tchankvetadze @ 2026-02-24 13:23 UTC (permalink / raw)
  To: Antoniu.Miclaus
  Cc: Nuno.Sa, lars, Michael.Hennerich, jic23, dlechner, andy,
	linux-iio, linux-kernel, Giorgi Tchankvetadze

The else branch of ade9000_iio_push_streaming() incorrectly returns
IRQ_HANDLED on regmap_write failure. This function returns int (0 on
success, negative errno on failure), so IRQ_HANDLED (1) would be
misinterpreted as a non-error by callers.

Return ret instead, consistent with every other error path in the
function.

Fixes: 81de7b4619fc ("iio: adc: add ade9000 support")
Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
---
Changes in v2 (Antoniu Miclaus):
 - Drop unrelated newline fix
 - Add Fixes tag

 drivers/iio/adc/ade9000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
index 5dcc26a08970..5d659f1bd3f7 100644
--- a/drivers/iio/adc/ade9000.c
+++ b/drivers/iio/adc/ade9000.c
@@ -787,7 +787,7 @@ static int ade9000_iio_push_streaming(struct iio_dev *indio_dev)
 				   ADE9000_MIDDLE_PAGE_BIT);
 		if (ret) {
 			dev_err_ratelimited(dev, "IRQ0 WFB write fail");
-			return IRQ_HANDLED;
+			return ret;
 		}
 
 		ade9000_configure_scan(indio_dev, ADE9000_REG_WF_BUFF);
-- 
2.52.0


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

* RE: [PATCH v2] iio: adc: ade9000: fix wrong return type in streaming push
  2026-02-24 13:23 ` [PATCH v2] " Giorgi Tchankvetadze
@ 2026-02-24 13:30   ` Miclaus, Antoniu
  2026-02-24 14:47   ` Andy Shevchenko
  1 sibling, 0 replies; 6+ messages in thread
From: Miclaus, Antoniu @ 2026-02-24 13:30 UTC (permalink / raw)
  To: Giorgi Tchankvetadze
  Cc: Sa, Nuno, lars@metafoo.de, Hennerich, Michael, jic23@kernel.org,
	David Lechner, andy@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org

> -----Original Message-----
> From: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
> Sent: Tuesday, February 24, 2026 3:24 PM
> To: Miclaus, Antoniu <Antoniu.Miclaus@analog.com>
> Cc: Sa, Nuno <Nuno.Sa@analog.com>; lars@metafoo.de; Hennerich, Michael
> <Michael.Hennerich@analog.com>; jic23@kernel.org; David Lechner
> <dlechner@baylibre.com>; andy@kernel.org; linux-iio@vger.kernel.org; linux-
> kernel@vger.kernel.org; Giorgi Tchankvetadze
> <giorgitchankvetadze1997@gmail.com>
> Subject: [PATCH v2] iio: adc: ade9000: fix wrong return type in streaming push
> 
> [External]
> 
> The else branch of ade9000_iio_push_streaming() incorrectly returns
> IRQ_HANDLED on regmap_write failure. This function returns int (0 on
> success, negative errno on failure), so IRQ_HANDLED (1) would be
> misinterpreted as a non-error by callers.
> 
> Return ret instead, consistent with every other error path in the
> function.
> 
> Fixes: 81de7b4619fc ("iio: adc: add ade9000 support")
> Signed-off-by: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
> ---

Reviewed-by: Antoniu Miclaus <antoniu.miclaus@analog.com>

> Changes in v2 (Antoniu Miclaus):
>  - Drop unrelated newline fix
>  - Add Fixes tag
> 
>  drivers/iio/adc/ade9000.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
> index 5dcc26a08970..5d659f1bd3f7 100644
> --- a/drivers/iio/adc/ade9000.c
> +++ b/drivers/iio/adc/ade9000.c
> @@ -787,7 +787,7 @@ static int ade9000_iio_push_streaming(struct iio_dev
> *indio_dev)
>  				   ADE9000_MIDDLE_PAGE_BIT);
>  		if (ret) {
>  			dev_err_ratelimited(dev, "IRQ0 WFB write fail");
> -			return IRQ_HANDLED;
> +			return ret;
>  		}
> 
>  		ade9000_configure_scan(indio_dev,
> ADE9000_REG_WF_BUFF);
> --
> 2.52.0


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

* Re: [PATCH v2] iio: adc: ade9000: fix wrong return type in streaming push
  2026-02-24 13:23 ` [PATCH v2] " Giorgi Tchankvetadze
  2026-02-24 13:30   ` Miclaus, Antoniu
@ 2026-02-24 14:47   ` Andy Shevchenko
  1 sibling, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2026-02-24 14:47 UTC (permalink / raw)
  To: Giorgi Tchankvetadze
  Cc: Antoniu.Miclaus, Nuno.Sa, lars, Michael.Hennerich, jic23,
	dlechner, andy, linux-iio, linux-kernel

On Tue, Feb 24, 2026 at 05:23:55PM +0400, Giorgi Tchankvetadze wrote:
> The else branch of ade9000_iio_push_streaming() incorrectly returns
> IRQ_HANDLED on regmap_write failure. This function returns int (0 on
> success, negative errno on failure), so IRQ_HANDLED (1) would be
> misinterpreted as a non-error by callers.
> 
> Return ret instead, consistent with every other error path in the
> function.

Again, do NOT start a _new_ version in the _previous_ version email thread.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH] iio: adc: ade9000: fix wrong return type in streaming push
  2026-02-24 13:09 ` Miclaus, Antoniu
@ 2026-02-24 14:49   ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2026-02-24 14:49 UTC (permalink / raw)
  To: Miclaus, Antoniu
  Cc: Giorgi Tchankvetadze, lars@metafoo.de, Hennerich, Michael,
	jic23@kernel.org, David Lechner, Sa, Nuno, andy@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org

On Tue, Feb 24, 2026 at 01:09:49PM +0000, Miclaus, Antoniu wrote:
> > From: Giorgi Tchankvetadze <giorgitchankvetadze1997@gmail.com>
> > Sent: Tuesday, February 24, 2026 2:59 PM

...

> > -			dev_err_ratelimited(dev, "IRQ0 WFB write fail");
> > +			dev_err_ratelimited(dev, "IRQ0 WFB write fail\n");
> 
> The `\n` is unrelated to the scope of this patch.

Seconded. Please, also check how many such cases in drivers/iio/* subfolders
and perhaps send one patch per the entire subfolder.

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2026-02-24 14:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-24 12:59 [PATCH] iio: adc: ade9000: fix wrong return type in streaming push Giorgi Tchankvetadze
2026-02-24 13:09 ` Miclaus, Antoniu
2026-02-24 14:49   ` Andy Shevchenko
2026-02-24 13:23 ` [PATCH v2] " Giorgi Tchankvetadze
2026-02-24 13:30   ` Miclaus, Antoniu
2026-02-24 14:47   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox