[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260205131234.3244467-4-harshit.m.mogalapalli@oracle.com>
Date: Thu, 5 Feb 2026 05:12:09 -0800
From: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
To: Jonathan Cameron <jic23@...nel.org>, David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>,
Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>,
Andrew Ijano <andrew.ijano@...il.com>,
Antoniu Miclaus <antoniu.miclaus@...log.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, andriy.shevchenko@...el.com
Subject: [PATCH v5 next 3/7] iio: sca3000: Move sca3000_stop_all_interrupts() above sca3000_probe()
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@...el.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
---
drivers/iio/accel/sca3000.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
index e270f445bb35..53628a0ee50a 100644
--- a/drivers/iio/accel/sca3000.c
+++ b/drivers/iio/accel/sca3000.c
@@ -1435,6 +1435,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;
@@ -1493,24 +1511,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);
--
2.47.3
Powered by blists - more mailing lists