]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: sca3000: Move sca3000_stop_all_interrupts() above sca3000_probe()
authorHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Thu, 5 Feb 2026 13:12:09 +0000 (05:12 -0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 3 Mar 2026 21:20:01 +0000 (21:20 +0000)
Move sca3000_stop_all_interrupts() above sca3000_probe() without
altering its logic so the next set of patches are easier to review.

No functional change.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/sca3000.c

index 274e8f3fb763ff4ac0edd9e65156799ca531b34e..156a9aa44c68e8a28281e7b603c179a7b776236e 100644 (file)
@@ -1427,6 +1427,24 @@ static const struct iio_info sca3000_info = {
        .write_event_config = &sca3000_write_event_config,
 };
 
+static int sca3000_stop_all_interrupts(struct sca3000_state *st)
+{
+       int ret;
+
+       mutex_lock(&st->lock);
+       ret = sca3000_read_data_short(st, SCA3000_REG_INT_MASK_ADDR, 1);
+       if (ret)
+               goto error_ret;
+       ret = sca3000_write_reg(st, SCA3000_REG_INT_MASK_ADDR,
+                               (st->rx[0] &
+                                ~(SCA3000_REG_INT_MASK_RING_THREE_QUARTER |
+                                  SCA3000_REG_INT_MASK_RING_HALF |
+                                  SCA3000_REG_INT_MASK_ALL_INTS)));
+error_ret:
+       mutex_unlock(&st->lock);
+       return ret;
+}
+
 static int sca3000_probe(struct spi_device *spi)
 {
        struct device *dev = &spi->dev;
@@ -1484,24 +1502,6 @@ static int sca3000_probe(struct spi_device *spi)
        return 0;
 }
 
-static int sca3000_stop_all_interrupts(struct sca3000_state *st)
-{
-       int ret;
-
-       mutex_lock(&st->lock);
-       ret = sca3000_read_data_short(st, SCA3000_REG_INT_MASK_ADDR, 1);
-       if (ret)
-               goto error_ret;
-       ret = sca3000_write_reg(st, SCA3000_REG_INT_MASK_ADDR,
-                               (st->rx[0] &
-                                ~(SCA3000_REG_INT_MASK_RING_THREE_QUARTER |
-                                  SCA3000_REG_INT_MASK_RING_HALF |
-                                  SCA3000_REG_INT_MASK_ALL_INTS)));
-error_ret:
-       mutex_unlock(&st->lock);
-       return ret;
-}
-
 static void sca3000_remove(struct spi_device *spi)
 {
        struct iio_dev *indio_dev = spi_get_drvdata(spi);