iio: light: ltr501: claim direct mode during raw writes
authorAlison Schofield <amsfield22@gmail.com>
Sun, 16 Oct 2016 05:02:19 +0000 (22:02 -0700)
committerJonathan Cameron <jic23@kernel.org>
Sun, 23 Oct 2016 18:34:08 +0000 (19:34 +0100)
commit4aee987380432c5814ef0275d4041de857dc0617
treee5d5e76ac02e7e2e38da763c5b8b3b52194eed79
parent218e95e9769b8335defc09b04244a78546cfb1e0
iio: light: ltr501: claim direct mode during raw writes

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

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