summaryrefslogtreecommitdiff
path: root/include/linux/errqueue.h
diff options
context:
space:
mode:
authorNeel Bullywon <neelb2403@gmail.com>2026-02-28 20:23:20 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2026-03-03 00:15:28 +0300
commit7031ee94438469732754cfdb23ae097adfe9336e (patch)
tree246be21d0ff40e948d4d7624931c98c516724ef7 /include/linux/errqueue.h
parentcd04646c0f3eefdde87538f6ff932420cedc9ba0 (diff)
downloadlinux-7031ee94438469732754cfdb23ae097adfe9336e.tar.xz
iio: magnetometer: bmc150_magn: use automated cleanup for mutex
Use guard() and scoped_guard() to replace manual mutex lock/unlock calls. This simplifies error handling and ensures RAII-style cleanup. guard() is used in read_raw, write_raw, trig_reen, and trigger_set_state. Case blocks using guard() in read_raw and write_raw are wrapped in braces at the case label level to ensure clear scope for the cleanup guards. A bmc150_magn_set_power_mode_locked() helper is added to deduplicate the lock-call-unlock pattern used by remove, runtime_suspend, suspend, and resume. The trigger_handler function is left unchanged as mixing guard() with goto error paths can be fragile. Signed-off-by: Neel Bullywon <neelb2403@gmail.com> Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include/linux/errqueue.h')
0 files changed, 0 insertions, 0 deletions