sensor: add mutex for get_sensor_data in accelerometer
authorJinhyung Choi <jinhyung2.choi@samsung.com>
Tue, 12 May 2015 05:02:15 +0000 (14:02 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 12 May 2015 07:38:15 +0000 (16:38 +0900)
Change-Id: I6cc802e5b2ca413984b285798a2867419cec3977
Signed-off-by: Jinhyung Choi <jinhyung2.choi@samsung.com>
drivers/maru/sensors/maru_accel.c

index 34db914..2faec4b 100644 (file)
@@ -308,7 +308,9 @@ static int set_initial_value(struct maru_accel_data *data)
 
        memset(sensor_data, 0, sizeof(sensor_data));
 
+       mutex_lock(&data->vs->vqlock);
        ret = get_sensor_data(sensor_type_accel_delay, sensor_data);
+       mutex_unlock(&data->vs->vqlock);
        if (ret) {
                ERR("failed to get initial delay time");
                return ret;