OSDN Git Service

iio: dac: ad7303: replace mlock with own lock
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Mon, 7 Oct 2019 08:26:42 +0000 (11:26 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 15 Oct 2019 20:11:07 +0000 (21:11 +0100)
commitc991bf9b650f39481cf3c1137092d4754a2c75de
tree44d5814ea986511ece954ab0b627821c7ada2bea
parentaf8dc7bf4ea2bbef4b4b87f3f29c139fe4561d6e
iio: dac: ad7303: replace mlock with own lock

This change replaces indio_dev's mlock with the driver's own lock. The lock
is mostly needed to protect state when changing the `dac_cache` info.
The lock has been extended to `ad7303_read_raw()`, to make sure that the
cache is updated if an SPI-write is already in progress.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/ad7303.c