iio: imu: adis: protect initial startup routine with state lock
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Fri, 22 Nov 2019 13:24:16 +0000 (15:24 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 23 Nov 2019 12:09:54 +0000 (12:09 +0000)
commitcb5a07f1f15cc3fd7e12bfdd48ba0e9fb585ea5e
tree6fd18e87d85d16afedadf50e6887fc2fc3ab43d8
parent762ab093cbe26451175a5a63ea06c971bf973525
iio: imu: adis: protect initial startup routine with state lock

The initial startup routine is called by some ADIS drivers during probe,
and before registering with IIO. Normally, userspace should not be able to
do any access to the device (as there shouldn't be any available).

This change extends the state lock to the entire initial-startup routine.
Behaviourally nothing should change, but this should make the library
function a bit more robust.

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