This v5 series refactors the bmc150_magn driver to use automated cleanup
helpers for mutex operations and modernizes the delay function usage.
Changes in v5:
- Split into two patches as requested by maintainer:
- Patch 1/2: All functional changes (guard/scoped_guard, fsleep)
- Patch 2/2: Pure formatting/style cleanups
- Use scoped_guard() instead of { guard(); ... } for short scopes
- Left trigger_handler unchanged per maintainer feedback
- Use fsleep() instead of usleep_range() per maintainer feedback
- Dropped formatting changes that did not improve readability
- Added braces around guard() in case blocks for clear scope
Changes in v4:
- Replace scoped_guard() with guard() to avoid lexical scope issues with goto
and return values which caused logic errors in previous versions.
- Replace msleep(5) with usleep_range(5000, 6000) to avoid checkpatch
warning.
- Fix indentation and line wrapping to cleanliness.
- Extend guard() usage to all mutex_lock() instances in the driver.
Changes in v3:
- Add Reviewed-by tags.
Changes in v2:
- Use guard() for mutex protection in bmc150_magn_data_rdy_trigger_set_state.
[Patch 1/2] Converts manual mutex_lock/unlock patterns to guard() and
scoped_guard() helpers, and replaces msleep(5) with fsleep(5000).
[Patch 2/2] Adds spaces inside braces for initializer lists and fixes
scan_masks array indentation. No functional changes.
Neel Bullywon (2):
iio: magnetometer: bmc150_magn: use automated cleanup for mutex
iio: magnetometer: bmc150_magn: minor formatting cleanup
drivers/iio/magnetometer/bmc150_magn.c | 161 +++++++++++--------------
1 file changed, 69 insertions(+), 92 deletions(-)
--
2.44.0