]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: adc: max1027: Move claim of direct mode up one level and use guard()
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 17 Feb 2025 14:16:23 +0000 (14:16 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 4 Mar 2025 13:17:50 +0000 (13:17 +0000)
commit2ce5314c689cd1541b9e96aceed98708309c49c8
treeb4cb0d98639d93403af2685d826a0e4f3100755a
parent173386d036336e8e75356ec89673a3f468f60b16
iio: adc: max1027: Move claim of direct mode up one level and use guard()

Move iio_device_claim_direct_mode() into the read_raw() callback
and use guard() to release a mutex. This enables simpler error
handling via direct returns.

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://patch.msgid.link/20250217141630.897334-24-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/max1027.c