public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Ethan Tidmore <ethantidmore06@gmail.com>
To: Antoniu Miclaus <antoniu.miclaus@analog.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Ethan Tidmore" <ethantidmore06@gmail.com>
Subject: [PATCH 1/3] iio: filter: admv8818: Add missing error code
Date: Fri, 27 Feb 2026 00:14:22 -0600	[thread overview]
Message-ID: <20260227061424.1135505-2-ethantidmore06@gmail.com> (raw)
In-Reply-To: <20260227061424.1135505-1-ethantidmore06@gmail.com>

If the macro FIELD_GET() returns an error code the function returns
with 0 because ret was just confirmed to be 0 a few lines above.

Add error code.

Detected by Smatch:
drivers/iio/filter/admv8818.c:335 __admv8818_read_hpf_freq() warn:
missing error code? 'ret'

drivers/iio/filter/admv8818.c:376 __admv8818_read_lpf_freq()
warn: missing error code? 'ret'

Fixes: f34fe888ad054 ("iio:filter:admv8818: add support for ADMV8818")
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
---
 drivers/iio/filter/admv8818.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/filter/admv8818.c b/drivers/iio/filter/admv8818.c
index e494fd33911b..4d5e7a9d806a 100644
--- a/drivers/iio/filter/admv8818.c
+++ b/drivers/iio/filter/admv8818.c
@@ -332,7 +332,7 @@ static int __admv8818_read_hpf_freq(struct admv8818_state *st, u64 *hpf_freq)
 	hpf_band = FIELD_GET(ADMV8818_SW_IN_WR0_MSK, data);
 	if (!hpf_band || hpf_band > 4) {
 		*hpf_freq = 0;
-		return ret;
+		return -EINVAL;
 	}
 
 	ret = regmap_read(st->regmap, ADMV8818_REG_WR0_FILTER, &data);
@@ -373,7 +373,7 @@ static int __admv8818_read_lpf_freq(struct admv8818_state *st, u64 *lpf_freq)
 	lpf_band = FIELD_GET(ADMV8818_SW_OUT_WR0_MSK, data);
 	if (!lpf_band || lpf_band > 4) {
 		*lpf_freq = 0;
-		return ret;
+		return -EINVAL;
 	}
 
 	ret = regmap_read(st->regmap, ADMV8818_REG_WR0_FILTER, &data);
-- 
2.53.0


  reply	other threads:[~2026-02-27  6:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-27  6:14 [PATCH 0/3] iio: filter: admv8818: Bug fix and other improvements Ethan Tidmore
2026-02-27  6:14 ` Ethan Tidmore [this message]
2026-02-27  6:42   ` [PATCH 1/3] iio: filter: admv8818: Add missing error code Ethan Tidmore
2026-02-27  7:06     ` Andy Shevchenko
2026-02-27 16:01       ` David Lechner
2026-02-27 16:06         ` Andy Shevchenko
2026-02-27  7:04   ` Andy Shevchenko
2026-02-27 16:02   ` David Lechner
2026-02-27  6:14 ` [PATCH 2/3] iio: filter: admv8818: Simplify locking with guard() Ethan Tidmore
2026-02-27  7:08   ` Andy Shevchenko
2026-02-27 16:08   ` David Lechner
2026-03-02 22:34     ` Ethan Tidmore
2026-02-27  6:14 ` [PATCH 3/3] iio: filter: admv8818: Minor cleanups Ethan Tidmore
2026-02-27  7:18   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260227061424.1135505-2-ethantidmore06@gmail.com \
    --to=ethantidmore06@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=antoniu.miclaus@analog.com \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox