]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: light: gp2ap020a00f: simplify locking with guard()
authorEthan Tidmore <ethantidmore06@gmail.com>
Mon, 23 Feb 2026 03:40:11 +0000 (21:40 -0600)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 23 Feb 2026 21:08:45 +0000 (21:08 +0000)
commit34be156c88080ce1a58d44e409e3ac41ced572c1
treed716811f1dabda2dcda31de467b4c9d5a9c64eb3
parentc99ccbba912c859fd579fe3a00071adc5fd0236d
iio: light: gp2ap020a00f: simplify locking with guard()

Use the guard() cleanup handler to manage the device lock.
This simplifies the code by removing the need for manual unlocking
and goto error handling paths.

Suggested-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/gp2ap020a00f.c