iio: light: ltr501: claim direct mode during select raw reads
authorAlison Schofield <amsfield22@gmail.com>
Sun, 16 Oct 2016 05:00:53 +0000 (22:00 -0700)
committerJonathan Cameron <jic23@kernel.org>
Sun, 23 Oct 2016 18:34:07 +0000 (19:34 +0100)
commit218e95e9769b8335defc09b04244a78546cfb1e0
tree5bcf795b8c218c4c6f1123b6855d592627dd23cd
parentd62e5fee88e26044a48d4b5632c4f89936041d92
iio: light: ltr501: claim direct mode during select raw reads

Driver was checking for direct mode but not locking it.  Use
claim/release helper functions to guarantee the device stays
in direct mode during required raw read cases.

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