• Akinobu Mita's avatar
    iio: adc: ti-ads1015: use iio_device_claim_direct_mode() · 47d8cf41
    Akinobu Mita authored
    While the iio buffer for the ti-ads1015 driver is enabled, reading the
    raw ADC channel data is restricted.  We usually use the
    iio_device_claim_direct_mode()/iio_device_release_direct_mode() pair for
    that.
    
    This change consequently reverses the locking order for the driver's
    private lock and indio_dev->mlock which acquired by
    iio_device_claim_direct_mode() internally. But it's safe because there is
    no other dependency between these locks.
    
    Cc: Daniel Baluta <daniel.baluta@gmail.com>
    Cc: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
    Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
    47d8cf41
ti-ads1015.c 18.3 KB