iio: imu: adis: create an unlocked version of adis_check_status()
This one also gets re-used in certain operations, so it makes sense to have an unlocked version of this to group it with other reads/writes/operations to have a single lock for the whole state change. Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:

committed by
Jonathan Cameron

parent
100bfa38c8
commit
6a4d6a7d65
@@ -267,7 +267,18 @@ static inline int adis_read_reg_32(struct adis *adis, unsigned int reg,
|
||||
}
|
||||
|
||||
int adis_enable_irq(struct adis *adis, bool enable);
|
||||
int adis_check_status(struct adis *adis);
|
||||
int __adis_check_status(struct adis *adis);
|
||||
|
||||
static inline int adis_check_status(struct adis *adis)
|
||||
{
|
||||
int ret;
|
||||
|
||||
mutex_lock(&adis->state_lock);
|
||||
ret = __adis_check_status(adis);
|
||||
mutex_unlock(&adis->state_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int adis_initial_startup(struct adis *adis);
|
||||
|
||||
|
Reference in New Issue
Block a user