]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: accel: msa311: Fix failure to release runtime pm if direct mode claim fails.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 17 Feb 2025 14:01:33 +0000 (14:01 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:37:33 +0000 (14:37 +0200)
commitd3f0bad2c43e7a145033680e47b393f0cbc0fa01
tree6d803e4d8d321b3f00904b42475bd0451635b78d
parent2d8c171e6212f9c3aaefec7019c753f3623f59a1
iio: accel: msa311: Fix failure to release runtime pm if direct mode claim fails.

[ Upstream commit 60a0cf2ebab92011055ab7db6553c0fc3c546938 ]

Reorder the claiming of direct mode and runtime pm calls to simplify
handling a little.  For correct error handling, after the reorder
iio_device_release_direct_mode() must be claimed in an error occurs
in pm_runtime_resume_and_get()

Fixes: 1ca2cfbc0c33 ("iio: add MEMSensing MSA311 3-axis accelerometer driver")
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250217140135.896574-7-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/accel/msa311.c