mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] iio: light: adux1020: guard() conversion and follow-up cleanup
@ 2026-11-17  7:11 Raffaele Tranfaglia via B4 Relay
  2026-11-17  7:11 ` [PATCH v2 1/2] iio: light: adux1020: use guard() to simplify lock handling Raffaele Tranfaglia via B4 Relay
  2026-11-17  7:11 ` [PATCH v2 2/2] iio: light: adux1020: return early on unsupported channel types Raffaele Tranfaglia via B4 Relay
  0 siblings, 2 replies; 3+ messages in thread
From: Raffaele Tranfaglia via B4 Relay @ 2026-11-17  7:11 UTC (permalink / raw)
  To: Nuno Sá,
	Michael Hennerich, Jonathan Cameron, David Lechner,
	Andy Shevchenko
  Cc: linux, linux-iio, linux-kernel, Raffaele Tranfaglia,
	Joshua Crofts, Andy Shevchenko

Patch 1 converts the driver to guard(mutex), as Jonathan suggested
when applying the sampling frequency hardening patch. Patch 2 uses the
direct returns this allows to flatten the channel type checks in
adux1020_read_raw() and adux1020_write_raw().

Tested on arm64 QEMU with i2c-stub and lockdep enabled: reading and
writing the sampling frequency (valid and invalid values), reading the
LED current, reading in_proximity_raw and enabling the threshold
event. No lockdep warnings and no hangs after the error paths.

I prepared these patches with the help of an AI coding assistant, and
reviewed and tested them myself.

Signed-off-by: Raffaele Tranfaglia <raffaele.tranfaglia@gmail.com>
---
Changes in v2:
- Drop the unreferenced Link tag (Andy)
- Move ret to the end of the declarations in adux1020_read_raw() (Andy)
- New patch 2: return early on unsupported channel types instead of
  nesting (Jonathan)
- Link to v1: https://patch.msgid.link/20261108-adux1020-guard-v1-1-db9c582f1eea@gmail.com

---
Raffaele Tranfaglia (2):
      iio: light: adux1020: use guard() to simplify lock handling
      iio: light: adux1020: return early on unsupported channel types

 drivers/iio/light/adux1020.c | 189 ++++++++++++++++++-------------------------
 1 file changed, 77 insertions(+), 112 deletions(-)
---
base-commit: d922ed738439e1d5b4701df7f4cdd49a09925624
change-id: 20261108-adux1020-guard-3820ce794843

Best regards,
--  
Raffaele Tranfaglia <raffaele.tranfaglia@gmail.com>



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

end of thread, other threads:[~2026-11-17  7:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17  7:11 [PATCH v2 0/2] iio: light: adux1020: guard() conversion and follow-up cleanup Raffaele Tranfaglia via B4 Relay
2026-11-17  7:11 ` [PATCH v2 1/2] iio: light: adux1020: use guard() to simplify lock handling Raffaele Tranfaglia via B4 Relay
2026-11-17  7:11 ` [PATCH v2 2/2] iio: light: adux1020: return early on unsupported channel types Raffaele Tranfaglia via B4 Relay

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

all inboxes | Powered by JetHome®