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:
Hartmut Knaack 2015-07-17 10:52:30 +02:00 committed by Jonathan Cameron
parent f9ba1ab4d1
commit 3021678a94
1 changed files with 1 additions and 1 deletions

View File

@ -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;