]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: frequency: admv4420: return proper error code from admv4420_calc_parameters()
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Fri, 30 Jan 2026 13:50:05 +0000 (15:50 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 3 Mar 2026 21:18:24 +0000 (21:18 +0000)
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>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/frequency/admv4420.c

index 3ae462b4f5c9f924dcd6a385a2502c6816852ec5..8748d974763971380d6397acd2478aaf2ce7e307 100644 (file)
@@ -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;