]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: ad7192: Factor out core of ad7192_write_raw() to simplify error handling.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 17 Feb 2025 14:16:10 +0000 (14:16 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 4 Mar 2025 13:17:49 +0000 (13:17 +0000)
commit32143dbd9591b404121aaec38a3455a3287f073d
tree5d571aa2363a3ff8de20428a009dce9fbab371a8
parent5ff6b02d9bb821e020910029857f150efeaa9d26
iio: adc: ad7192: Factor out core of ad7192_write_raw() to simplify error handling.

Factor out everything under the lock, use guard() for the mutex to
avoid need to manually unlock, and switch sense of matching checks
in loops to reduce indent.

There are some functional changes in here as well as the code
no longer updates the filter_freq_available if no change has
been made to the oversampling ratio.

Cc: Alisa-Dariana Roman <alisa.roman@analog.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20250217141630.897334-11-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7192.c