• simran singhal's avatar
    staging: iio: adis16060: Remove iio_dev mlock and refactor code · 9dde479e
    simran singhal authored
    The IIO subsystem is redefining iio_dev->mlock to be used by
    the IIO core only for protecting device operating mode changes.
    ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes.
    
    In this driver, mlock was being used to protect hardware state changes.
    
    In the driver, buf_lock protects both the adis16060_spi_write() and
    adis16060_spi_read() functions and both are always called in
    pair. First write, then read. Refactor the code to have
    one single function adis16060_spi_write_than_read() protected by
    the buf_lock.  This removes the need for additional locking via
    mlock, so this locking is removed.
    Signed-off-by: default avatarsimran singhal <singhalsimran0@gmail.com>
    Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
    9dde479e
adis16060_core.c 5.15 KB