iio: pressure: ms5611: claim direct mode during oversampling changes
authorAlison Schofield <amsfield22@gmail.com>
Fri, 20 Jan 2017 20:22:58 +0000 (12:22 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Nov 2017 14:53:14 +0000 (15:53 +0100)
commit87e4965cec6156351892ecf45251c8dec03cc752
tree69b2208e3d661c2344113172e9f906206c2ee492
parent19d0541bd2c22a1413017465069f4aa4cae00b43
iio: pressure: ms5611: claim direct mode during oversampling changes

[ Upstream commit 3bc1abcddb24f55b9c251e03caa4f9bd22ff748b ]

Driver was checking for direct mode before changing oversampling
ratios, but was not locking it.  Use the claim/release helper
functions to guarantee the device stays in direct mode while the
oversampling ratios are being updated.  Continue to use the drivers
private state lock to protect against conflicting direct mode access
of the state data.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/pressure/ms5611_core.c