mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iio: frequency: admv4420: return proper error code from admv4420_calc_parameters()
@ 2026-01-30 13:50 Antoniu Miclaus
  2026-01-31 17:08 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Antoniu Miclaus @ 2026-01-30 13:50 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	David Lechner, Nuno Sá,
	Andy Shevchenko, linux-iio, linux-kernel
  Cc: Antoniu Miclaus

Return -EINVAL instead of -1 when no valid PLL parameters solution is
found. Using standard kernel error codes ensures consistency and proper
error propagation through the call chain.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
 drivers/iio/frequency/admv4420.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/frequency/admv4420.c b/drivers/iio/frequency/admv4420.c
index 3ae462b4f5c9..8748d9747639 100644
--- a/drivers/iio/frequency/admv4420.c
+++ b/drivers/iio/frequency/admv4420.c
@@ -243,7 +243,7 @@ static int admv4420_calc_parameters(struct admv4420_state *st)
 		st->n_counter.n_counter = 1;
 	}
 	if (!sol_found)
-		return -1;
+		return -EINVAL;
 
 	st->n_counter.int_val = div_u64_rem(st->n_counter.n_counter, 10, &st->n_counter.frac_val);
 	st->n_counter.mod_val = 10;
-- 
2.43.0


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

* Re: [PATCH] iio: frequency: admv4420: return proper error code from admv4420_calc_parameters()
  2026-01-30 13:50 [PATCH] iio: frequency: admv4420: return proper error code from admv4420_calc_parameters() Antoniu Miclaus
@ 2026-01-31 17:08 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2026-01-31 17:08 UTC (permalink / raw)
  To: Antoniu Miclaus
  Cc: Lars-Peter Clausen, Michael Hennerich, David Lechner,
	Nuno Sá,
	Andy Shevchenko, linux-iio, linux-kernel

On Fri, 30 Jan 2026 15:50:05 +0200
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:

> Return -EINVAL instead of -1 when no valid PLL parameters solution is
> found. Using standard kernel error codes ensures consistency and proper
> error propagation through the call chain.
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Applied to a local branch. I'll need to rebase on something sensible after
the merge window. For now I'll push out as testing.

Thanks

Jonathan

> ---
>  drivers/iio/frequency/admv4420.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/frequency/admv4420.c b/drivers/iio/frequency/admv4420.c
> index 3ae462b4f5c9..8748d9747639 100644
> --- a/drivers/iio/frequency/admv4420.c
> +++ b/drivers/iio/frequency/admv4420.c
> @@ -243,7 +243,7 @@ static int admv4420_calc_parameters(struct admv4420_state *st)
>  		st->n_counter.n_counter = 1;
>  	}
>  	if (!sol_found)
> -		return -1;
> +		return -EINVAL;
>  
>  	st->n_counter.int_val = div_u64_rem(st->n_counter.n_counter, 10, &st->n_counter.frac_val);
>  	st->n_counter.mod_val = 10;


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

end of thread, other threads:[~2026-01-31 17:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-30 13:50 [PATCH] iio: frequency: admv4420: return proper error code from admv4420_calc_parameters() Antoniu Miclaus
2026-01-31 17:08 ` Jonathan Cameron

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

all inboxes | Powered by JetHome®