mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-13 23:34:05 +08:00
iio:magnetometer:bmc150_magn: expand mutex in trigger_handler
Keep the mutex locked, until the content of data->buffer has been pushed out. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Irina Tirdea <irina.tirdea@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
f9ba1ab4d1
commit
3021678a94
@ -664,7 +664,6 @@ static irqreturn_t bmc150_magn_trigger_handler(int irq, void *p)
|
||||
|
||||
mutex_lock(&data->mutex);
|
||||
ret = bmc150_magn_read_xyz(data, data->buffer);
|
||||
mutex_unlock(&data->mutex);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
@ -672,6 +671,7 @@ static irqreturn_t bmc150_magn_trigger_handler(int irq, void *p)
|
||||
pf->timestamp);
|
||||
|
||||
err:
|
||||
mutex_unlock(&data->mutex);
|
||||
iio_trigger_notify_done(indio_dev->trig);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
|
Loading…
Reference in New Issue
Block a user