]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: at91_adc: change at91_ts_sample to return void
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Mon, 2 Feb 2026 11:57:30 +0000 (13:57 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 23 Feb 2026 21:00:58 +0000 (21:00 +0000)
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>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/at91_adc.c

index 920dd9ffd27a594a3be90cd6e4a57ef8d437dc3d..8942d15b39780b72f38414f8513bb969896b94b9 100644 (file)
@@ -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)