public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 next 0/5] IIO: sca3000: devm resource management
@ 2026-02-02 19:40 Harshit Mogalapalli
  2026-02-02 19:40 ` [PATCH v2 next 1/5] iio: sca3000: cache SPI device ID in probe Harshit Mogalapalli
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Harshit Mogalapalli @ 2026-02-02 19:40 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, error27, andriy.shevchenko

Hi,

This is an attempt to update sca3000 accelerometer driver to make use
of devm_ based helpers where needed. I have split it into 5 patches.

Patch 1 - some refactoring and simplification.
Patch 2 - switches request_threaded_irq() over to the devm helper
Patch 3 - Used devm_add_action_or_reset() for disabling interrupts.
(Ensured the ordering of teardown bits remain same)
Patch 4 - manage device registration with devm helper
Patch 5 - Make use of guard() in sca3000_stop_all_interrupts() function.

Thanks a lot to Jonathan for detailed review of V1.

During v1 review comments, Jonathan Cameron kindly provided some great
suggestions to improve this driver. One of them is making use of
gaurd(mutex) - autocleanup style, patch 5 does that for one function.

Yet to be addressed tasks:
1. We shouldn't be using the spi_device_id at all.
2. Modernize other fucntions 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.

v1->v2 changes are documented in patches where necessary.

Thanks for your time.

Regards,
Harshit

Harshit Mogalapalli (5):
  iio: sca3000: cache SPI device ID in probe
  iio: sca3000: switch IRQ handling to devm helpers
  iio: sca3000: stop interrupts via devm_add_action_or_reset()
  iio: sca3000: manage device registration with devm helper
  iio: sca3000: use guard(mutex) to simplify return paths

 drivers/iio/accel/sca3000.c | 99 +++++++++++++++++--------------------
 1 file changed, 44 insertions(+), 55 deletions(-)

-- 
2.47.3


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2026-02-03 15:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-02 19:40 [PATCH v2 next 0/5] IIO: sca3000: devm resource management Harshit Mogalapalli
2026-02-02 19:40 ` [PATCH v2 next 1/5] iio: sca3000: cache SPI device ID in probe Harshit Mogalapalli
2026-02-02 23:01   ` David Lechner
2026-02-03 10:24     ` Harshit Mogalapalli
2026-02-03 15:26       ` David Lechner
2026-02-02 19:40 ` [PATCH v2 next 2/5] iio: sca3000: switch IRQ handling to devm helpers Harshit Mogalapalli
2026-02-02 23:06   ` David Lechner
2026-02-02 19:40 ` [PATCH v2 next 3/5] iio: sca3000: stop interrupts via devm_add_action_or_reset() Harshit Mogalapalli
2026-02-02 23:04   ` David Lechner
2026-02-03 10:27     ` Harshit Mogalapalli
2026-02-02 19:40 ` [PATCH v2 next 4/5] iio: sca3000: manage device registration with devm helper Harshit Mogalapalli
2026-02-02 23:07   ` David Lechner
2026-02-03 12:29     ` Harshit Mogalapalli
2026-02-02 19:40 ` [PATCH v2 next 5/5] iio: sca3000: use guard(mutex) to simplify return paths Harshit Mogalapalli
2026-02-02 23:09   ` David Lechner
2026-02-03  9:48 ` [PATCH v2 next 0/5] IIO: sca3000: devm resource management Andy Shevchenko
2026-02-03 10:29   ` Harshit Mogalapalli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox