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>
This commit is contained in:
Maxwell Doose 2026-05-23 13:15:36 -05:00 • committed by Jonathan Cameron
commit d2b3d461a0