From: Hartmut Knaack Date: Fri, 17 Jul 2015 08:52:30 +0000 (+0200) Subject: iio:magnetometer:bmc150_magn: expand mutex in trigger_handler X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3021678a94cdb942bea4e634a37e91fe341b27b0;p=linux-beck.git 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 Acked-by: Irina Tirdea Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c index 074a99da7367..324412d51cf8 100644 --- a/drivers/iio/magnetometer/bmc150_magn.c +++ b/drivers/iio/magnetometer/bmc150_magn.c @@ -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;