iio: pressure: mpl3115: factor out core of IIO_INFO_RAW read to simplify code flow
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 31 Mar 2025 12:13:06 +0000 (13:13 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 22 Apr 2025 18:10:00 +0000 (19:10 +0100)
commit770ee1a2c5d99a72914f521f894d6d1c0624837a
treef0cf9c2a9a3857c4c87dc091f0f7a313b9ba674f
parentb2a3a51000a71cd33337b05b5a3df78ba89a6727
iio: pressure: mpl3115: factor out core of IIO_INFO_RAW read to simplify code flow

Apply guard(mutex) to remove the need for manual release of the lock.
Factor out the code that occurs under the direct claim.
These two changes allow for direct returns simplifying code flow.

Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://patch.msgid.link/20250331121317.1694135-27-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/mpl3115.c