]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: chemical: sps30: Replace manual locking with RAII locking
authorMaxwell Doose <m32285159@gmail.com>
Sat, 23 May 2026 18:15:36 +0000 (13:15 -0500)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 10:01:48 +0000 (11:01 +0100)
commitd2b3d461a09e0db6a6a8237db4081a32f71a04b9
tree1d78e6234f2ecb4172938c6bfd5806ab82bce436
parent1ccae88c0a1023e0c9f757dc6b1fbca463b32b36
iio: chemical: sps30: Replace manual locking with RAII locking

Replace manual mutex_lock() and mutex_unlock() calls with the much newer
guard(mutex)() macro to enable RAII patterns, modernize the driver, and
to increase readability.

Move mutex locking into sps30_do_meas() and tune it up to use guard()(),
as every caller takes the lock anyways.

Signed-off-by: Maxwell Doose <m32285159@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/chemical/sps30.c