Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v3 0/2] iio: light: iqs621-als: use lock guards and prefer early error handling
@ 2026-04-29  1:29 Pedro Barletta Gennari
  2026-04-29  1:29 ` [PATCH v3 1/2] iio: light: iqs621-als: use lock guards Pedro Barletta Gennari
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pedro Barletta Gennari @ 2026-04-29  1:29 UTC (permalink / raw)
  To: andy, dlechner, jic23, nuno.sa; +Cc: pedro.pbg, linux-iio

Use guard(mutex)() for handling mutex lock instead of manually
locking and unlocking the mutex and flip 'if (!ret)' to 'if (ret)'
to handle errors early in drivers/iio/light/iqs621-als.c

Patch 2 depends on patch 1

Signed-off-by: Pedro Barletta Gennari <pedro.pbg@usp.br>
---
v3:
  - Remove unnecessary { }
  - Remove unnecessary ret initialization
  - Flip 'if (!ret)' to 'if (ret)'
v2:
  - Keep include list ordered
  - Remove redundant 'else'
  - Remove unnecessary variable 'ret'
---

Pedro Barletta Gennari (2):
  iio: light: iqs621-als: use lock guards
  iio: light: iqs621-als: prefer early error handling over if (!ret)

 drivers/iio/light/iqs621-als.c | 111 +++++++++++++--------------------
 1 file changed, 43 insertions(+), 68 deletions(-)

-- 
2.51.0


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

end of thread, other threads:[~2026-05-05 16:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-29  1:29 [PATCH v3 0/2] iio: light: iqs621-als: use lock guards and prefer early error handling Pedro Barletta Gennari
2026-04-29  1:29 ` [PATCH v3 1/2] iio: light: iqs621-als: use lock guards Pedro Barletta Gennari
2026-04-29  1:29 ` [PATCH v3 2/2] iio: light: iqs621-als: prefer early error handling over if (!ret) Pedro Barletta Gennari
2026-04-29 20:01 ` [PATCH v3 0/2] iio: light: iqs621-als: use lock guards and prefer early error handling Andy Shevchenko
2026-05-05 16:35   ` Jonathan Cameron

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