From: Antoniu Miclaus <antoniu.miclaus@analog.com>
To: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2] iio: adc: at91_adc: change at91_ts_sample to return void
Date: Mon, 2 Feb 2026 13:57:30 +0200 [thread overview]
Message-ID: <20260202115733.21382-1-antoniu.miclaus@analog.com> (raw)
The return value of at91_ts_sample() is never checked by its caller.
Change the return type to void to make this explicit. The error
conditions are already logged via dev_err() which provides sufficient
visibility into hardware issues.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
Changes in v2:
- Changed return type to void instead of replacing -1 with -EIO,
since the return value is never checked by the caller.
drivers/iio/adc/at91_adc.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index 920dd9ffd27a..8942d15b3978 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -304,7 +304,7 @@ static void handle_adc_eoc_trigger(int irq, struct iio_dev *idev)
}
}
-static int at91_ts_sample(struct iio_dev *idev)
+static void at91_ts_sample(struct iio_dev *idev)
{
struct at91_adc_state *st = iio_priv(idev);
unsigned int xscale, yscale, reg, z1, z2;
@@ -323,7 +323,7 @@ static int at91_ts_sample(struct iio_dev *idev)
xscale = (reg >> 16) & xyz_mask;
if (xscale == 0) {
dev_err(&idev->dev, "Error: xscale == 0!\n");
- return -1;
+ return;
}
x /= xscale;
@@ -334,7 +334,7 @@ static int at91_ts_sample(struct iio_dev *idev)
yscale = (reg >> 16) & xyz_mask;
if (yscale == 0) {
dev_err(&idev->dev, "Error: yscale == 0!\n");
- return -1;
+ return;
}
y /= yscale;
@@ -363,8 +363,6 @@ static int at91_ts_sample(struct iio_dev *idev)
} else {
dev_dbg(&idev->dev, "pressure too low: not reporting\n");
}
-
- return 0;
}
static irqreturn_t at91_adc_rl_interrupt(int irq, void *private)
--
2.43.0
next reply other threads:[~2026-02-02 11:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-02 11:57 Antoniu Miclaus [this message]
2026-02-02 15:11 ` [PATCH v2] iio: adc: at91_adc: change at91_ts_sample to return void David Lechner
2026-02-22 18:59 ` Jonathan Cameron
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=20260202115733.21382-1-antoniu.miclaus@analog.com \
--to=antoniu.miclaus@analog.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andy@kernel.org \
--cc=claudiu.beznea@tuxon.dev \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--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