Protect bmc150_magn_runtime_resume() with a mutex, as done with other suspend/resume functions. Signed-off-by: Hartmut Knaack <knaack.h@xxxxxx> --- drivers/iio/magnetometer/bmc150_magn.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c index e1f804b2b244..ac0cdbde813b 100644 --- a/drivers/iio/magnetometer/bmc150_magn.c +++ b/drivers/iio/magnetometer/bmc150_magn.c @@ -1052,9 +1052,14 @@ static int bmc150_magn_runtime_resume(struct device *dev) { struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); struct bmc150_magn_data *data = iio_priv(indio_dev); + int ret; - return bmc150_magn_set_power_mode(data, BMC150_MAGN_POWER_MODE_NORMAL, - true); + mutex_lock(&data->mutex); + ret = bmc150_magn_set_power_mode(data, BMC150_MAGN_POWER_MODE_NORMAL, + true); + mutex_unlock(&data->mutex); + + return ret; } #endif -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html