* [PATCH v5 next 1/7] iio: sca3000: reuse device pointer for devm helpers
2026-02-05 13:12 [PATCH v5 next 0/7] IIO: sca3000: devm resource management Harshit Mogalapalli
@ 2026-02-05 13:12 ` Harshit Mogalapalli
2026-02-05 13:12 ` [PATCH v5 next 2/7] iio: sca3000: switch IRQ handling to " Harshit Mogalapalli
` (6 subsequent siblings)
7 siblings, 0 replies; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-02-05 13:12 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Harshit Mogalapalli, Gustavo Bastos, Andrew Ijano,
Antoniu Miclaus, linux-iio, linux-kernel
Cc: kernel-janitors, andriy.shevchenko
Cache struct device *dev and feed it to the devm helpers to simplify
the probe function. No functional changes.
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
drivers/iio/accel/sca3000.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
index 4a827be439a2..43373c798714 100644
--- a/drivers/iio/accel/sca3000.c
+++ b/drivers/iio/accel/sca3000.c
@@ -1437,11 +1437,12 @@ static const struct iio_info sca3000_info = {
static int sca3000_probe(struct spi_device *spi)
{
- int ret;
+ struct device *dev = &spi->dev;
struct sca3000_state *st;
struct iio_dev *indio_dev;
+ int ret;
- indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
+ indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
if (!indio_dev)
return -ENOMEM;
@@ -1464,8 +1465,7 @@ static int sca3000_probe(struct spi_device *spi)
}
indio_dev->modes = INDIO_DIRECT_MODE;
- ret = devm_iio_kfifo_buffer_setup(&spi->dev, indio_dev,
- &sca3000_ring_setup_ops);
+ ret = devm_iio_kfifo_buffer_setup(dev, indio_dev, &sca3000_ring_setup_ops);
if (ret)
return ret;
--
2.47.3
^ permalink raw reply related [flat|nested] 28+ messages in thread* [PATCH v5 next 2/7] iio: sca3000: switch IRQ handling to devm helpers
2026-02-05 13:12 [PATCH v5 next 0/7] IIO: sca3000: devm resource management Harshit Mogalapalli
2026-02-05 13:12 ` [PATCH v5 next 1/7] iio: sca3000: reuse device pointer for devm helpers Harshit Mogalapalli
@ 2026-02-05 13:12 ` Harshit Mogalapalli
2026-02-05 16:23 ` Andy Shevchenko
2026-02-05 13:12 ` [PATCH v5 next 3/7] iio: sca3000: Move sca3000_stop_all_interrupts() above sca3000_probe() Harshit Mogalapalli
` (5 subsequent siblings)
7 siblings, 1 reply; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-02-05 13:12 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Harshit Mogalapalli, Antoniu Miclaus, Andrew Ijano, linux-iio,
linux-kernel
Cc: kernel-janitors, andriy.shevchenko
Convert the threaded IRQ registration to devm_request_threaded_irq() so
that the probe and remove paths can drop manual freeing of irqs.
No functionality change.
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
drivers/iio/accel/sca3000.c | 25 ++++++++-----------------
1 file changed, 8 insertions(+), 17 deletions(-)
diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
index 43373c798714..e270f445bb35 100644
--- a/drivers/iio/accel/sca3000.c
+++ b/drivers/iio/accel/sca3000.c
@@ -1470,34 +1470,27 @@ static int sca3000_probe(struct spi_device *spi)
return ret;
if (spi->irq) {
- ret = request_threaded_irq(spi->irq,
- NULL,
- &sca3000_event_handler,
- IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
- "sca3000",
- indio_dev);
+ ret = devm_request_threaded_irq(dev, spi->irq, NULL,
+ &sca3000_event_handler,
+ IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+ "sca3000",
+ indio_dev);
if (ret)
return ret;
}
ret = sca3000_clean_setup(st);
if (ret)
- goto error_free_irq;
+ return ret;
ret = sca3000_print_rev(indio_dev);
if (ret)
- goto error_free_irq;
+ return ret;
ret = iio_device_register(indio_dev);
if (ret)
- goto error_free_irq;
+ return ret;
return 0;
-
-error_free_irq:
- if (spi->irq)
- free_irq(spi->irq, indio_dev);
-
- return ret;
}
static int sca3000_stop_all_interrupts(struct sca3000_state *st)
@@ -1527,8 +1520,6 @@ static void sca3000_remove(struct spi_device *spi)
/* Must ensure no interrupts can be generated after this! */
sca3000_stop_all_interrupts(st);
- if (spi->irq)
- free_irq(spi->irq, indio_dev);
}
static const struct spi_device_id sca3000_id[] = {
--
2.47.3
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH v5 next 2/7] iio: sca3000: switch IRQ handling to devm helpers
2026-02-05 13:12 ` [PATCH v5 next 2/7] iio: sca3000: switch IRQ handling to " Harshit Mogalapalli
@ 2026-02-05 16:23 ` Andy Shevchenko
2026-02-05 16:39 ` Harshit Mogalapalli
0 siblings, 1 reply; 28+ messages in thread
From: Andy Shevchenko @ 2026-02-05 16:23 UTC (permalink / raw)
To: Harshit Mogalapalli
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Antoniu Miclaus, Andrew Ijano, linux-iio, linux-kernel,
kernel-janitors
On Thu, Feb 05, 2026 at 05:12:08AM -0800, Harshit Mogalapalli wrote:
> Convert the threaded IRQ registration to devm_request_threaded_irq() so
> that the probe and remove paths can drop manual freeing of irqs.
>
> No functionality change.
...
> -error_free_irq:
> - if (spi->irq)
> - free_irq(spi->irq, indio_dev);
> -
> - return ret;
...
> - if (spi->irq)
> - free_irq(spi->irq, indio_dev);
Do we need an irq member to be in the struct after this patch?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 2/7] iio: sca3000: switch IRQ handling to devm helpers
2026-02-05 16:23 ` Andy Shevchenko
@ 2026-02-05 16:39 ` Harshit Mogalapalli
2026-02-05 16:45 ` Andy Shevchenko
0 siblings, 1 reply; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-02-05 16:39 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Antoniu Miclaus, Andrew Ijano, linux-iio, linux-kernel,
kernel-janitors
Hi Andy,
On 05/02/26 21:53, Andy Shevchenko wrote:
> On Thu, Feb 05, 2026 at 05:12:08AM -0800, Harshit Mogalapalli wrote:
>> Convert the threaded IRQ registration to devm_request_threaded_irq() so
>> that the probe and remove paths can drop manual freeing of irqs.
>>
>> No functionality change.
>
> ...
>
Thanks for the reviews!
>> -error_free_irq:
>> - if (spi->irq)
>> - free_irq(spi->irq, indio_dev);
>> -
>> - return ret;
>
> ...
>
>> - if (spi->irq)
>> - free_irq(spi->irq, indio_dev);
>
> Do we need an irq member to be in the struct after this patch?
I probably didn't understand that question fully.
we still have a call to ret = devm_request_threaded_irq(dev, spi->irq,
NULL,...) so we can't relaly get rid of the irq member I think, did I
understand your question right ?
Thanks,
Harshit
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 2/7] iio: sca3000: switch IRQ handling to devm helpers
2026-02-05 16:39 ` Harshit Mogalapalli
@ 2026-02-05 16:45 ` Andy Shevchenko
2026-02-05 16:49 ` Harshit Mogalapalli
0 siblings, 1 reply; 28+ messages in thread
From: Andy Shevchenko @ 2026-02-05 16:45 UTC (permalink / raw)
To: Harshit Mogalapalli
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Antoniu Miclaus, Andrew Ijano, linux-iio, linux-kernel,
kernel-janitors
On Thu, Feb 05, 2026 at 10:09:45PM +0530, Harshit Mogalapalli wrote:
> On 05/02/26 21:53, Andy Shevchenko wrote:
> > On Thu, Feb 05, 2026 at 05:12:08AM -0800, Harshit Mogalapalli wrote:
...
> > > - if (spi->irq)
> > > - free_irq(spi->irq, indio_dev);
> >
> > Do we need an irq member to be in the struct after this patch?
>
> I probably didn't understand that question fully.
>
> we still have a call to ret = devm_request_threaded_irq(dev, spi->irq,
> NULL,...) so we can't relaly get rid of the irq member I think,
> did I understand your question right ?
Yes. But now I realised that this is the external structure, and not the one
the driver defines. Sorry for the noise.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 2/7] iio: sca3000: switch IRQ handling to devm helpers
2026-02-05 16:45 ` Andy Shevchenko
@ 2026-02-05 16:49 ` Harshit Mogalapalli
0 siblings, 0 replies; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-02-05 16:49 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Antoniu Miclaus, Andrew Ijano, linux-iio, linux-kernel,
kernel-janitors
On 05/02/26 22:15, Andy Shevchenko wrote:
> On Thu, Feb 05, 2026 at 10:09:45PM +0530, Harshit Mogalapalli wrote:
>> On 05/02/26 21:53, Andy Shevchenko wrote:
>>> On Thu, Feb 05, 2026 at 05:12:08AM -0800, Harshit Mogalapalli wrote:
>
> ...
>
>>>> - if (spi->irq)
>>>> - free_irq(spi->irq, indio_dev);
>>>
>>> Do we need an irq member to be in the struct after this patch?
>>
>> I probably didn't understand that question fully.
>>
>> we still have a call to ret = devm_request_threaded_irq(dev, spi->irq,
>> NULL,...) so we can't relaly get rid of the irq member I think,
>> did I understand your question right ?
>
> Yes. But now I realised that this is the external structure, and not the one
> the driver defines. Sorry for the noise.
>
Np, yes this is part of spi_device a more central structure. Thanks for
checking!
Regards,
Harshit
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH v5 next 3/7] iio: sca3000: Move sca3000_stop_all_interrupts() above sca3000_probe()
2026-02-05 13:12 [PATCH v5 next 0/7] IIO: sca3000: devm resource management Harshit Mogalapalli
2026-02-05 13:12 ` [PATCH v5 next 1/7] iio: sca3000: reuse device pointer for devm helpers Harshit Mogalapalli
2026-02-05 13:12 ` [PATCH v5 next 2/7] iio: sca3000: switch IRQ handling to " Harshit Mogalapalli
@ 2026-02-05 13:12 ` Harshit Mogalapalli
2026-02-05 16:22 ` Andy Shevchenko
2026-02-05 13:12 ` [PATCH v5 next 4/7] iio: sca3000: make stop_all_interrupts() return void Harshit Mogalapalli
` (4 subsequent siblings)
7 siblings, 1 reply; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-02-05 13:12 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Harshit Mogalapalli, Andrew Ijano, Antoniu Miclaus, linux-iio,
linux-kernel
Cc: kernel-janitors, andriy.shevchenko
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>
---
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
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH v5 next 3/7] iio: sca3000: Move sca3000_stop_all_interrupts() above sca3000_probe()
2026-02-05 13:12 ` [PATCH v5 next 3/7] iio: sca3000: Move sca3000_stop_all_interrupts() above sca3000_probe() Harshit Mogalapalli
@ 2026-02-05 16:22 ` Andy Shevchenko
0 siblings, 0 replies; 28+ messages in thread
From: Andy Shevchenko @ 2026-02-05 16:22 UTC (permalink / raw)
To: Harshit Mogalapalli
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Ijano, Antoniu Miclaus, linux-iio, linux-kernel,
kernel-janitors
On Thu, Feb 05, 2026 at 05:12:09AM -0800, Harshit Mogalapalli wrote:
> 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.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH v5 next 4/7] iio: sca3000: make stop_all_interrupts() return void
2026-02-05 13:12 [PATCH v5 next 0/7] IIO: sca3000: devm resource management Harshit Mogalapalli
` (2 preceding siblings ...)
2026-02-05 13:12 ` [PATCH v5 next 3/7] iio: sca3000: Move sca3000_stop_all_interrupts() above sca3000_probe() Harshit Mogalapalli
@ 2026-02-05 13:12 ` Harshit Mogalapalli
2026-02-05 16:24 ` Andy Shevchenko
2026-02-05 13:12 ` [PATCH v5 next 5/7] iio: sca3000: use guard(mutex) to simplify return paths Harshit Mogalapalli
` (3 subsequent siblings)
7 siblings, 1 reply; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-02-05 13:12 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Harshit Mogalapalli, Gustavo Bastos, Antoniu Miclaus,
Andrew Ijano, linux-iio, linux-kernel
Cc: kernel-janitors, andriy.shevchenko
sca3000_stop_all_interrupts() is called only from the driver remove
path and its return value is discarded, so convert the helper to return
void.
No functional change.
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
v4->v5: Keep the label unchanged as its all going away in next patch [
Based on suggestion from Andy, thanks Andy.
---
drivers/iio/accel/sca3000.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
index 53628a0ee50a..d3e2a981874d 100644
--- a/drivers/iio/accel/sca3000.c
+++ b/drivers/iio/accel/sca3000.c
@@ -1435,7 +1435,7 @@ static const struct iio_info sca3000_info = {
.write_event_config = &sca3000_write_event_config,
};
-static int sca3000_stop_all_interrupts(struct sca3000_state *st)
+static void sca3000_stop_all_interrupts(struct sca3000_state *st)
{
int ret;
@@ -1443,14 +1443,13 @@ static int sca3000_stop_all_interrupts(struct sca3000_state *st)
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)));
+ 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)
--
2.47.3
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH v5 next 4/7] iio: sca3000: make stop_all_interrupts() return void
2026-02-05 13:12 ` [PATCH v5 next 4/7] iio: sca3000: make stop_all_interrupts() return void Harshit Mogalapalli
@ 2026-02-05 16:24 ` Andy Shevchenko
0 siblings, 0 replies; 28+ messages in thread
From: Andy Shevchenko @ 2026-02-05 16:24 UTC (permalink / raw)
To: Harshit Mogalapalli
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Gustavo Bastos, Antoniu Miclaus, Andrew Ijano, linux-iio,
linux-kernel, kernel-janitors
On Thu, Feb 05, 2026 at 05:12:10AM -0800, Harshit Mogalapalli wrote:
> sca3000_stop_all_interrupts() is called only from the driver remove
> path and its return value is discarded, so convert the helper to return
> void.
>
> No functional change.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH v5 next 5/7] iio: sca3000: use guard(mutex) to simplify return paths
2026-02-05 13:12 [PATCH v5 next 0/7] IIO: sca3000: devm resource management Harshit Mogalapalli
` (3 preceding siblings ...)
2026-02-05 13:12 ` [PATCH v5 next 4/7] iio: sca3000: make stop_all_interrupts() return void Harshit Mogalapalli
@ 2026-02-05 13:12 ` Harshit Mogalapalli
2026-02-05 16:26 ` Andy Shevchenko
2026-02-05 13:12 ` [PATCH v5 next 6/7] iio: sca3000: stop interrupts via devm_add_action_or_reset() Harshit Mogalapalli
` (2 subsequent siblings)
7 siblings, 1 reply; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-02-05 13:12 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Harshit Mogalapalli, Andrew Ijano, Antoniu Miclaus, linux-iio,
linux-kernel
Cc: kernel-janitors, andriy.shevchenko
Switch sca3000_stop_all_interrupts() to use guard(mutex) to simplify the
error paths without needing a goto.
Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
v4->v5: rebase it accordingly as we didn't change label "error_ret" in
the previous patch.
---
drivers/iio/accel/sca3000.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
index d3e2a981874d..56ff646684c0 100644
--- a/drivers/iio/accel/sca3000.c
+++ b/drivers/iio/accel/sca3000.c
@@ -7,6 +7,7 @@
* See industrialio/accels/sca3000.h for comments.
*/
+#include <linux/cleanup.h>
#include <linux/interrupt.h>
#include <linux/fs.h>
#include <linux/device.h>
@@ -1439,17 +1440,17 @@ static void sca3000_stop_all_interrupts(struct sca3000_state *st)
{
int ret;
- mutex_lock(&st->lock);
+ guard(mutex)(&st->lock);
+
ret = sca3000_read_data_short(st, SCA3000_REG_INT_MASK_ADDR, 1);
if (ret)
- goto error_ret;
+ return;
+
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);
}
static int sca3000_probe(struct spi_device *spi)
--
2.47.3
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH v5 next 5/7] iio: sca3000: use guard(mutex) to simplify return paths
2026-02-05 13:12 ` [PATCH v5 next 5/7] iio: sca3000: use guard(mutex) to simplify return paths Harshit Mogalapalli
@ 2026-02-05 16:26 ` Andy Shevchenko
2026-02-05 16:39 ` Harshit Mogalapalli
0 siblings, 1 reply; 28+ messages in thread
From: Andy Shevchenko @ 2026-02-05 16:26 UTC (permalink / raw)
To: Harshit Mogalapalli
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Ijano, Antoniu Miclaus, linux-iio, linux-kernel,
kernel-janitors
On Thu, Feb 05, 2026 at 05:12:11AM -0800, Harshit Mogalapalli wrote:
> Switch sca3000_stop_all_interrupts() to use guard(mutex) to simplify the
> error paths without needing a goto.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> ---
> v4->v5: rebase it accordingly as we didn't change label "error_ret" in
> the previous patch.
I hope you see the difference and how the whole series gets better.
> ---
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 5/7] iio: sca3000: use guard(mutex) to simplify return paths
2026-02-05 16:26 ` Andy Shevchenko
@ 2026-02-05 16:39 ` Harshit Mogalapalli
0 siblings, 0 replies; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-02-05 16:39 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Ijano, Antoniu Miclaus, linux-iio, linux-kernel,
kernel-janitors
Hi Andy,
On 05/02/26 21:56, Andy Shevchenko wrote:
> On Thu, Feb 05, 2026 at 05:12:11AM -0800, Harshit Mogalapalli wrote:
>> Switch sca3000_stop_all_interrupts() to use guard(mutex) to simplify the
>> error paths without needing a goto.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
>
>> ---
>> v4->v5: rebase it accordingly as we didn't change label "error_ret" in
>> the previous patch.
>
> I hope you see the difference and how the whole series gets better.
>
Yes I do, thank you very much for the guidance on this :)
Thanks,
Harshit
>> ---
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH v5 next 6/7] iio: sca3000: stop interrupts via devm_add_action_or_reset()
2026-02-05 13:12 [PATCH v5 next 0/7] IIO: sca3000: devm resource management Harshit Mogalapalli
` (4 preceding siblings ...)
2026-02-05 13:12 ` [PATCH v5 next 5/7] iio: sca3000: use guard(mutex) to simplify return paths Harshit Mogalapalli
@ 2026-02-05 13:12 ` Harshit Mogalapalli
2026-02-05 16:27 ` Andy Shevchenko
2026-02-05 13:12 ` [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper Harshit Mogalapalli
2026-02-05 16:30 ` [PATCH v5 next 0/7] IIO: sca3000: devm resource management Andy Shevchenko
7 siblings, 1 reply; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-02-05 13:12 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Harshit Mogalapalli, Andrew Ijano, Antoniu Miclaus, linux-iio,
linux-kernel
Cc: kernel-janitors, andriy.shevchenko
Used devm_add_action_or_reset() for shutting down the interrupts.
Make sca3000_stop_all_interrupts() return void now that it always hooks
into devm cleanup.
No functional change intended.
Suggested-by: David Lechner <dlechner@baylibre.com>
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
v4->v5: Offloaded the move of the sca3000_stop_all_interrupts() above
probe in a earlier patch, thanks to Andy for the suggestion of making
this simple.
---
drivers/iio/accel/sca3000.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
index 56ff646684c0..cfc3353f7ffd 100644
--- a/drivers/iio/accel/sca3000.c
+++ b/drivers/iio/accel/sca3000.c
@@ -1436,8 +1436,10 @@ static const struct iio_info sca3000_info = {
.write_event_config = &sca3000_write_event_config,
};
-static void sca3000_stop_all_interrupts(struct sca3000_state *st)
+static void sca3000_stop_all_interrupts(void *data)
{
+ struct iio_dev *indio_dev = data;
+ struct sca3000_state *st = iio_priv(indio_dev);
int ret;
guard(mutex)(&st->lock);
@@ -1504,6 +1506,10 @@ static int sca3000_probe(struct spi_device *spi)
if (ret)
return ret;
+ ret = devm_add_action_or_reset(dev, sca3000_stop_all_interrupts, indio_dev);
+ if (ret)
+ return ret;
+
ret = iio_device_register(indio_dev);
if (ret)
return ret;
@@ -1514,12 +1520,8 @@ static int sca3000_probe(struct spi_device *spi)
static void sca3000_remove(struct spi_device *spi)
{
struct iio_dev *indio_dev = spi_get_drvdata(spi);
- struct sca3000_state *st = iio_priv(indio_dev);
iio_device_unregister(indio_dev);
-
- /* Must ensure no interrupts can be generated after this! */
- sca3000_stop_all_interrupts(st);
}
static const struct spi_device_id sca3000_id[] = {
--
2.47.3
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH v5 next 6/7] iio: sca3000: stop interrupts via devm_add_action_or_reset()
2026-02-05 13:12 ` [PATCH v5 next 6/7] iio: sca3000: stop interrupts via devm_add_action_or_reset() Harshit Mogalapalli
@ 2026-02-05 16:27 ` Andy Shevchenko
0 siblings, 0 replies; 28+ messages in thread
From: Andy Shevchenko @ 2026-02-05 16:27 UTC (permalink / raw)
To: Harshit Mogalapalli
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Ijano, Antoniu Miclaus, linux-iio, linux-kernel,
kernel-janitors
On Thu, Feb 05, 2026 at 05:12:12AM -0800, Harshit Mogalapalli wrote:
> Used devm_add_action_or_reset() for shutting down the interrupts.
> Make sca3000_stop_all_interrupts() return void now that it always hooks
> into devm cleanup.
>
> No functional change intended.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper
2026-02-05 13:12 [PATCH v5 next 0/7] IIO: sca3000: devm resource management Harshit Mogalapalli
` (5 preceding siblings ...)
2026-02-05 13:12 ` [PATCH v5 next 6/7] iio: sca3000: stop interrupts via devm_add_action_or_reset() Harshit Mogalapalli
@ 2026-02-05 13:12 ` Harshit Mogalapalli
2026-02-05 16:29 ` Andy Shevchenko
2026-02-05 16:30 ` [PATCH v5 next 0/7] IIO: sca3000: devm resource management Andy Shevchenko
7 siblings, 1 reply; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-02-05 13:12 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Harshit Mogalapalli, Antoniu Miclaus, Andrew Ijano, linux-iio,
linux-kernel
Cc: kernel-janitors, andriy.shevchenko, David Lechner
Convert the iio registration to use devm_* helpers so the probe no
longer needs a separate cleanup path and remove callback can also drop
the unregister. After this there is no need for having a remove
callback, so remote it.
No functional change intended.
Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: David Lechner <dlechner@baylibe.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
v4->v5: Add RB from Andy.
---
drivers/iio/accel/sca3000.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/iio/accel/sca3000.c b/drivers/iio/accel/sca3000.c
index cfc3353f7ffd..49abe4ece233 100644
--- a/drivers/iio/accel/sca3000.c
+++ b/drivers/iio/accel/sca3000.c
@@ -1510,18 +1510,7 @@ static int sca3000_probe(struct spi_device *spi)
if (ret)
return ret;
- ret = iio_device_register(indio_dev);
- if (ret)
- return ret;
-
- return 0;
-}
-
-static void sca3000_remove(struct spi_device *spi)
-{
- struct iio_dev *indio_dev = spi_get_drvdata(spi);
-
- iio_device_unregister(indio_dev);
+ return devm_iio_device_register(dev, indio_dev);
}
static const struct spi_device_id sca3000_id[] = {
@@ -1538,7 +1527,6 @@ static struct spi_driver sca3000_driver = {
.name = "sca3000",
},
.probe = sca3000_probe,
- .remove = sca3000_remove,
.id_table = sca3000_id,
};
module_spi_driver(sca3000_driver);
--
2.47.3
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper
2026-02-05 13:12 ` [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper Harshit Mogalapalli
@ 2026-02-05 16:29 ` Andy Shevchenko
2026-02-05 16:51 ` Harshit Mogalapalli
0 siblings, 1 reply; 28+ messages in thread
From: Andy Shevchenko @ 2026-02-05 16:29 UTC (permalink / raw)
To: Harshit Mogalapalli
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Antoniu Miclaus, Andrew Ijano, linux-iio, linux-kernel,
kernel-janitors, David Lechner
On Thu, Feb 05, 2026 at 05:12:13AM -0800, Harshit Mogalapalli wrote:
> Convert the iio registration to use devm_* helpers so the probe no
> longer needs a separate cleanup path and remove callback can also drop
> the unregister. After this there is no need for having a remove
> callback, so remote it.
>
> No functional change intended.
...
> - struct iio_dev *indio_dev = spi_get_drvdata(spi);
Do you still need spi_set_drvdata() or analogue in the ->probe()?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper
2026-02-05 16:29 ` Andy Shevchenko
@ 2026-02-05 16:51 ` Harshit Mogalapalli
2026-02-05 16:56 ` Andy Shevchenko
0 siblings, 1 reply; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-02-05 16:51 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Antoniu Miclaus, Andrew Ijano, linux-iio, linux-kernel,
kernel-janitors, David Lechner
Hi Andy,
On 05/02/26 21:59, Andy Shevchenko wrote:
> On Thu, Feb 05, 2026 at 05:12:13AM -0800, Harshit Mogalapalli wrote:
>> Convert the iio registration to use devm_* helpers so the probe no
>> longer needs a separate cleanup path and remove callback can also drop
>> the unregister. After this there is no need for having a remove
>> callback, so remote it.
>>
>> No functional change intended.
>
> ...
>
>> - struct iio_dev *indio_dev = spi_get_drvdata(spi);
>
> Do you still need spi_set_drvdata() or analogue in the ->probe()?
>
That's a great catch, I don't see spi_get_drvdata() anymore after this
series, so yes I think we should get rid of this.
Should I fold that into this patch in v6, as spi_get_drvdata() is also
removed in this patch ?
Thanks,
Harshit
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper
2026-02-05 16:51 ` Harshit Mogalapalli
@ 2026-02-05 16:56 ` Andy Shevchenko
2026-02-05 17:00 ` Harshit Mogalapalli
0 siblings, 1 reply; 28+ messages in thread
From: Andy Shevchenko @ 2026-02-05 16:56 UTC (permalink / raw)
To: Harshit Mogalapalli
Cc: Andy Shevchenko, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Antoniu Miclaus, Andrew Ijano, linux-iio,
linux-kernel, kernel-janitors, David Lechner
On Thu, Feb 5, 2026 at 6:51 PM Harshit Mogalapalli
<harshit.m.mogalapalli@oracle.com> wrote:
> On 05/02/26 21:59, Andy Shevchenko wrote:
> > On Thu, Feb 05, 2026 at 05:12:13AM -0800, Harshit Mogalapalli wrote:
...
> >> - struct iio_dev *indio_dev = spi_get_drvdata(spi);
> >
> > Do you still need spi_set_drvdata() or analogue in the ->probe()?
> >
>
> That's a great catch, I don't see spi_get_drvdata() anymore after this
> series, so yes I think we should get rid of this.
>
> Should I fold that into this patch in v6, as spi_get_drvdata() is also
> removed in this patch ?
Ideally it should be done in this patch, but let's wait for Jonathan.
He usually may tweak these small things when applying.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper
2026-02-05 16:56 ` Andy Shevchenko
@ 2026-02-05 17:00 ` Harshit Mogalapalli
2026-02-05 17:12 ` Andy Shevchenko
0 siblings, 1 reply; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-02-05 17:00 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Andy Shevchenko, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Antoniu Miclaus, Andrew Ijano, linux-iio,
linux-kernel, kernel-janitors, David Lechner
Hi Andy,
On 05/02/26 22:26, Andy Shevchenko wrote:
> On Thu, Feb 5, 2026 at 6:51 PM Harshit Mogalapalli
> <harshit.m.mogalapalli@oracle.com> wrote:
>> On 05/02/26 21:59, Andy Shevchenko wrote:
>>> On Thu, Feb 05, 2026 at 05:12:13AM -0800, Harshit Mogalapalli wrote:
>
> ...
>
>>>> - struct iio_dev *indio_dev = spi_get_drvdata(spi);
>>>
>>> Do you still need spi_set_drvdata() or analogue in the ->probe()?
>>>
>>
>> That's a great catch, I don't see spi_get_drvdata() anymore after this
>> series, so yes I think we should get rid of this.
>>
>> Should I fold that into this patch in v6, as spi_get_drvdata() is also
>> removed in this patch ?
>
> Ideally it should be done in this patch, but let's wait for Jonathan.
> He usually may tweak these small things when applying.
>
Also, while checking the patch now, I see I copied a wrong tag(RB with
missing r in baylibre from [1])
So that's one more thing to fix. Let me know if v6 would be a preferred
approach, I can do it.
Thanks,
Harshit
[1]
https://lore.kernel.org/all/a5fa2f97-9ba3-4085-bfaf-a255d24a81f0@baylibre.com/
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper
2026-02-05 17:00 ` Harshit Mogalapalli
@ 2026-02-05 17:12 ` Andy Shevchenko
2026-02-05 19:58 ` Jonathan Cameron
0 siblings, 1 reply; 28+ messages in thread
From: Andy Shevchenko @ 2026-02-05 17:12 UTC (permalink / raw)
To: Harshit Mogalapalli
Cc: Andy Shevchenko, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Antoniu Miclaus, Andrew Ijano, linux-iio,
linux-kernel, kernel-janitors, David Lechner
On Thu, Feb 05, 2026 at 10:30:31PM +0530, Harshit Mogalapalli wrote:
> On 05/02/26 22:26, Andy Shevchenko wrote:
> > On Thu, Feb 5, 2026 at 6:51 PM Harshit Mogalapalli
> > <harshit.m.mogalapalli@oracle.com> wrote:
> > > On 05/02/26 21:59, Andy Shevchenko wrote:
> > > > On Thu, Feb 05, 2026 at 05:12:13AM -0800, Harshit Mogalapalli wrote:
...
> > > > > - struct iio_dev *indio_dev = spi_get_drvdata(spi);
> > > >
> > > > Do you still need spi_set_drvdata() or analogue in the ->probe()?
> > > >
> > >
> > > That's a great catch, I don't see spi_get_drvdata() anymore after this
> > > series, so yes I think we should get rid of this.
> > >
> > > Should I fold that into this patch in v6, as spi_get_drvdata() is also
> > > removed in this patch ?
> >
> > Ideally it should be done in this patch, but let's wait for Jonathan.
> > He usually may tweak these small things when applying.
> >
>
> Also, while checking the patch now, I see I copied a wrong tag(RB with
> missing r in baylibre from [1])
>
> So that's one more thing to fix. Let me know if v6 would be a preferred
> approach, I can do it.
Let's not hurry, wait for Jonathan to decide.
> [1] https://lore.kernel.org/all/a5fa2f97-9ba3-4085-bfaf-a255d24a81f0@baylibre.com/
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper
2026-02-05 17:12 ` Andy Shevchenko
@ 2026-02-05 19:58 ` Jonathan Cameron
2026-02-05 20:10 ` Harshit Mogalapalli
2026-03-03 12:14 ` Harshit Mogalapalli
0 siblings, 2 replies; 28+ messages in thread
From: Jonathan Cameron @ 2026-02-05 19:58 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Harshit Mogalapalli, Andy Shevchenko, David Lechner, Nuno Sá,
Andy Shevchenko, Antoniu Miclaus, Andrew Ijano, linux-iio,
linux-kernel, kernel-janitors, David Lechner
On Thu, 5 Feb 2026 19:12:50 +0200
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Thu, Feb 05, 2026 at 10:30:31PM +0530, Harshit Mogalapalli wrote:
> > On 05/02/26 22:26, Andy Shevchenko wrote:
> > > On Thu, Feb 5, 2026 at 6:51 PM Harshit Mogalapalli
> > > <harshit.m.mogalapalli@oracle.com> wrote:
> > > > On 05/02/26 21:59, Andy Shevchenko wrote:
> > > > > On Thu, Feb 05, 2026 at 05:12:13AM -0800, Harshit Mogalapalli wrote:
>
> ...
>
> > > > > > - struct iio_dev *indio_dev = spi_get_drvdata(spi);
> > > > >
> > > > > Do you still need spi_set_drvdata() or analogue in the ->probe()?
> > > > >
> > > >
> > > > That's a great catch, I don't see spi_get_drvdata() anymore after this
> > > > series, so yes I think we should get rid of this.
> > > >
> > > > Should I fold that into this patch in v6, as spi_get_drvdata() is also
> > > > removed in this patch ?
> > >
> > > Ideally it should be done in this patch, but let's wait for Jonathan.
> > > He usually may tweak these small things when applying.
I removed it.
> > >
> >
> > Also, while checking the patch now, I see I copied a wrong tag(RB with
> > missing r in baylibre from [1])
Fixed that up.
> >
> > So that's one more thing to fix. Let me know if v6 would be a preferred
> > approach, I can do it.
>
> Let's not hurry, wait for Jonathan to decide.
>
> > [1] https://lore.kernel.org/all/a5fa2f97-9ba3-4085-bfaf-a255d24a81f0@baylibre.com/
>
And applied to the testing branch of iio.git. Note this will be
rebased after rc1 is out before I push it out as a branch linux-next picks
up.
thanks,
Jonathan
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper
2026-02-05 19:58 ` Jonathan Cameron
@ 2026-02-05 20:10 ` Harshit Mogalapalli
2026-03-03 12:14 ` Harshit Mogalapalli
1 sibling, 0 replies; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-02-05 20:10 UTC (permalink / raw)
To: Jonathan Cameron, Andy Shevchenko
Cc: Andy Shevchenko, David Lechner, Nuno Sá, Andy Shevchenko,
Antoniu Miclaus, Andrew Ijano, linux-iio, linux-kernel,
kernel-janitors, David Lechner
Hi Jonathan,
On 06/02/26 01:28, Jonathan Cameron wrote:
> And applied to the testing branch of iio.git. Note this will be
> rebased after rc1 is out before I push it out as a branch linux-next picks
> up.
>
Thanks a lot !
Regards,
Harshit
> thanks,
>
> Jonathan
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper
2026-02-05 19:58 ` Jonathan Cameron
2026-02-05 20:10 ` Harshit Mogalapalli
@ 2026-03-03 12:14 ` Harshit Mogalapalli
2026-03-03 21:41 ` Jonathan Cameron
1 sibling, 1 reply; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-03-03 12:14 UTC (permalink / raw)
To: Jonathan Cameron, Andy Shevchenko
Cc: Andy Shevchenko, David Lechner, Nuno Sá, Andy Shevchenko,
Antoniu Miclaus, Andrew Ijano, linux-iio, linux-kernel,
kernel-janitors, David Lechner
Hi Jonathan,
>>>> Ideally it should be done in this patch, but let's wait for Jonathan.
>>>> He usually may tweak these small things when applying.
> I removed it.
>>>>
>>>
>>> Also, while checking the patch now, I see I copied a wrong tag(RB with
>>> missing r in baylibre from [1])
> Fixed that up.
>>>
>>> So that's one more thing to fix. Let me know if v6 would be a preferred
>>> approach, I can do it.
>>
>> Let's not hurry, wait for Jonathan to decide.
>>
>>> [1] https://lore.kernel.org/all/a5fa2f97-9ba3-4085-bfaf-a255d24a81f0@baylibre.com/
>>
>
> And applied to the testing branch of iio.git. Note this will be
> rebased after rc1 is out before I push it out as a branch linux-next picks
> up.
I don't see them here:
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/log/?h=testing
Would it be easier if I send a V6 ? With everything fixed.
Thanks,
Harshit
>
> thanks,
>
> Jonathan
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper
2026-03-03 12:14 ` Harshit Mogalapalli
@ 2026-03-03 21:41 ` Jonathan Cameron
2026-03-03 21:44 ` Harshit Mogalapalli
0 siblings, 1 reply; 28+ messages in thread
From: Jonathan Cameron @ 2026-03-03 21:41 UTC (permalink / raw)
To: Harshit Mogalapalli
Cc: Andy Shevchenko, Andy Shevchenko, David Lechner, Nuno Sá,
Andy Shevchenko, Antoniu Miclaus, Andrew Ijano, linux-iio,
linux-kernel, kernel-janitors, David Lechner
On Tue, 3 Mar 2026 17:44:28 +0530
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> wrote:
> Hi Jonathan,
>
> >>>> Ideally it should be done in this patch, but let's wait for Jonathan.
> >>>> He usually may tweak these small things when applying.
> > I removed it.
> >>>>
> >>>
> >>> Also, while checking the patch now, I see I copied a wrong tag(RB with
> >>> missing r in baylibre from [1])
> > Fixed that up.
> >>>
> >>> So that's one more thing to fix. Let me know if v6 would be a preferred
> >>> approach, I can do it.
> >>
> >> Let's not hurry, wait for Jonathan to decide.
> >>
> >>> [1] https://lore.kernel.org/all/a5fa2f97-9ba3-4085-bfaf-a255d24a81f0@baylibre.com/
> >>
> >
> > And applied to the testing branch of iio.git. Note this will be
> > rebased after rc1 is out before I push it out as a branch linux-next picks
> > up.
>
> I don't see them here:
> https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/log/?h=testing
>
> Would it be easier if I send a V6 ? With everything fixed.
Gah. I managed to eat the temporary branch i was using due to the odd timing.
Good thing you raised this as it had quite a few patches on it :(
Someone else reported a missing patch the other day but only the
second report made me wonder if I was going crazy and spot what I'd done.
I've cherry-picked everything off that branch onto the one I accidentally
switched to. So 'now' testing should have the lot.
If there are additional changes, please send them on top of the testing
branch. Thanks again for raising this!
Jonathan
>
>
> Thanks,
> Harshit
> >
> > thanks,
> >
> > Jonathan
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper
2026-03-03 21:41 ` Jonathan Cameron
@ 2026-03-03 21:44 ` Harshit Mogalapalli
0 siblings, 0 replies; 28+ messages in thread
From: Harshit Mogalapalli @ 2026-03-03 21:44 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Andy Shevchenko, Andy Shevchenko, David Lechner, Nuno Sá,
Andy Shevchenko, Antoniu Miclaus, Andrew Ijano, linux-iio,
linux-kernel, kernel-janitors, David Lechner
Hi Jonathan,
On 04/03/26 03:11, Jonathan Cameron wrote:
> Gah. I managed to eat the temporary branch i was using due to the odd timing.
>
> Good thing you raised this as it had quite a few patches on it 🙁
> Someone else reported a missing patch the other day but only the
> second report made me wonder if I was going crazy and spot what I'd done.
>
> I've cherry-picked everything off that branch onto the one I accidentally
> switched to. So 'now' testing should have the lot.
>
Thanks a lot!
> If there are additional changes, please send them on top of the testing
> branch. Thanks again for raising this!
>
Glad to know the ping was useful.
Regards,
Harshit
> Jonathan
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH v5 next 0/7] IIO: sca3000: devm resource management
2026-02-05 13:12 [PATCH v5 next 0/7] IIO: sca3000: devm resource management Harshit Mogalapalli
` (6 preceding siblings ...)
2026-02-05 13:12 ` [PATCH v5 next 7/7] iio: sca3000: manage device registration with devm helper Harshit Mogalapalli
@ 2026-02-05 16:30 ` Andy Shevchenko
7 siblings, 0 replies; 28+ messages in thread
From: Andy Shevchenko @ 2026-02-05 16:30 UTC (permalink / raw)
To: Harshit Mogalapalli
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Andrew Ijano, Antoniu Miclaus, linux-iio, linux-kernel,
kernel-janitors
On Thu, Feb 05, 2026 at 05:12:06AM -0800, Harshit Mogalapalli wrote:
> This is an attempt to update sca3000 accelerometer driver to make use
> of devm_ based helpers where needed. I have split it into 6 patches.
>
> Patch 1 - some refactoring and simplification of dev.
> Patch 2 - switches request_threaded_irq() over to the devm helper
> {atch 3 - Move stop_all_interrupts() above probe
> Patch 4 - make stop_all_interrupts() return void
> Patch 5 - Make use of guard() in sca3000_stop_all_interrupts() function.
> Patch 6 - Used devm_add_action_or_reset() for disabling interrupts.
> (Ensured the ordering of teardown bits remain same)
> Patch 7 - manage device registration with devm helper
>
> Yet to be addressed tasks: (Would like to take this up as a separate
> activity)
> 1. We shouldn't be using the spi_device_id at all. [Thanks to onathan
> and David]
> 2. Modernize other functions to make use of autocleanup style locking
> which simpifies the code and makes error paths cleaner.
>
> I will be working on these two above tasks and will be sending a
> different patches for those.
>
> The series builds cleanly and I have performed static analysis with
> smatch checker but haven't tested on actual hardware.
LGTM, but there are a couple of things I noticed while going thru the patches
again. They maybe addressed later, or if, Jonathan asks, in the next version.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 28+ messages in thread