Skip to content

iio: light: zopt2201: Convert mutex usage to lock guards

Gabriel Almeida linux-iio 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest2 patches 4 repliesIn review

Changes in v3 from the cover letter

- Split header reordering into a separate patch
- Simplified control flow in zopt2201_write_scale_by_idx()

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2iio: light: zopt2201: Reorder header includesdrivers/iio/light/zopt2201.c+5 -62 replies
2/2iio: light: zopt2201: use lock guardsdrivers/iio/light/zopt2201.c+12 -211 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] iio: light: zopt2201: Convert mutex usage to lock guards

This series replaces mutex_lock()/mutex_unlock() pairs with the guard() and scoped_guard() helpers in the zopt2201 driver.

The first patch reorders the header includes to follow kernel style conventions. The second patch converts the remaining mutex usage to lock guards and simplifies the control flow accordingly.

Changes in v3:
- Split header reordering into a separate patch
- Simplified control flow in zopt2201_write_scale_by_idx()

Changes in v2:
- Reordered headers
- Added required <linux/cleanup.h> include
- Used lock guards in zopt2201_read()
- Used scoped_guard() in zopt2201_write_resolution()

Changes in v1:
- Initial version

Gabriel Almeida (2):
iio: light: zopt2201: Reorder header includes
iio: light: zopt2201: use lock guards

 drivers/iio/light/zopt2201.c | 44 ++++++++++++++----------------------
 1 file changed, 17 insertions(+), 27 deletions(-)
Signature · 1 line
2.43.0