]> git.baikalelectronics.ru Git - kernel.git/commit
iio: light: tcs3414: use iio helper function to guarantee direct mode
authorAlison Schofield <amsfield22@gmail.com>
Tue, 7 Jun 2016 05:09:21 +0000 (22:09 -0700)
committerJonathan Cameron <jic23@kernel.org>
Sat, 11 Jun 2016 16:14:08 +0000 (17:14 +0100)
commit0fa496d59f1ec8bfe15e320e8f80dfc50af68992
treec76b221426bd42e14381eed3ae5c54f2e108f1de
parent8e6dfafe5ee9676cef09ae035352dc8ed7e0289a
iio: light: tcs3414: use iio helper function to guarantee direct mode

Replace the code that guarantees the device stays in direct mode
with iio_device_claim_direct_mode() which does same.  This allows
removal of an unused lock in the device private global data.

Also prevents a possible race around a buffer being enabled whilst
a read is going on.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Cc: Daniel Baluta <daniel.baluta@gmail.com>
Acked-by: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/tcs3414.c