[PATCH 0/2] iio: light: iqs621-als: use lock guards and prefer early error handling
Pedro Barletta Gennari
pedro.pbg em usp.br
Ter Abr 28 20:35:49 -03 2026
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 dependes on patch 1
Signed-off-by: Pedro Barletta Gennari <pedro.pbg em 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
Mais detalhes sobre a lista de discussão kernel