patch "iio: frequency: admv1013: propagate errors from" added to char-misc-linus
This is a note to let you know that I've just added the patch titled
iio: frequency: admv1013: propagate errors from
to my char-misc git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
in the char-misc-linus branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.
If you have any questions about this process, please let me know.
From 507397d19b5a296aa339f7a1bd16284f668a1906 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <[email protected]>
Date: Tue, 18 Jul 2023 10:02:18 +0300
Subject: iio: frequency: admv1013: propagate errors from
regulator_get_voltage()
The regulator_get_voltage() function returns negative error codes. This function saves it to an unsigned int and then does some range checking and, since the error code falls outside the correct range, it returns -EINVAL.
Beyond the messiness, this is bad because the regulator_get_voltage() function can return -EPROBE_DEFER and it's important to propagate that back properly so it can be handled.
--- drivers/iio/frequency/admv1013.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/iio/frequency/admv1013.c +4 -1
@@ -344,9 +344,12 @@ static int admv1013_update_quad_filters(struct admv1013_state *st)static int admv1013_update_mixer_vgate (struct admv1013_state *st) { -unsigned int vcm, mixer_vgate; +unsigned int mixer_vgate; +int vcm; vcm =regulator_get_voltage (st->reg); +if (vcm <0 ) +return vcm;if (vcm <1800000 ) mixer_vgate = (2389 * vcm /1000000 +8100 ) /100 ;
Signature · 1 line
2.41.0