Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ca70c79 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: iio: imu: Moved mutex lock after return function"

parents 70f6427d 8c27384c
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -301,9 +301,9 @@ void inv_convert_and_push_8bytes(struct inv_mpu_state *st, u16 hdr,
static void store_acc_boot_sample(struct inv_mpu_state *st, u64 t,
						s16 x, s16 y, s16 z)
{
	mutex_lock(&st->acc_sensor_buff);
	if (false == st->acc_buffer_inv_samples)
		return;
	mutex_lock(&st->acc_sensor_buff);
	st->timestamp.tv64 = t;
	if (ktime_to_timespec(st->timestamp).tv_sec
			<  st->max_buffer_time) {
@@ -334,10 +334,9 @@ static void store_acc_boot_sample(struct inv_mpu_state *st, u64 t,
static void store_gyro_boot_sample(struct inv_mpu_state *st, u64 t,
						s16 x, s16 y, s16 z)
{

	mutex_lock(&st->gyro_sensor_buff);
	if (false == st->gyro_buffer_inv_samples)
		return;
	mutex_lock(&st->gyro_sensor_buff);
	st->timestamp.tv64 = t;
	if (ktime_to_timespec(st->timestamp).tv_sec
			<  st->max_buffer_time) {
+1 −1
Original line number Diff line number Diff line
@@ -200,10 +200,10 @@ static void store_acc_gyro_boot_sample(struct st_asm330lhh_sensor *sensor,
{
	int x, y, z;

	mutex_lock(&sensor->sensor_buff);
	if (false == sensor->buffer_asm_samples)
		return;

	mutex_lock(&sensor->sensor_buff);
	sensor->timestamp = (ktime_t)tsample;
	x = iio_buf[1]<<8|iio_buf[0];
	y = iio_buf[3]<<8|iio_buf[2];
+1 −1
Original line number Diff line number Diff line
@@ -6965,9 +6965,9 @@ static void smi130_acc_slope_interrupt_handle(struct smi130_acc_data *smi130_acc
static void store_acc_boot_sample(struct smi130_acc_data *client_data,
				int x, int y, int z, struct timespec ts)
{
	mutex_lock(&client_data->acc_sensor_buff);
	if (false == client_data->acc_buffer_smi130_samples)
		return;
	mutex_lock(&client_data->acc_sensor_buff);
	if (ts.tv_sec <  client_data->max_buffer_time) {
		if (client_data->acc_bufsample_cnt < SMI_ACC_MAXSAMPLE) {
			client_data->smi130_acc_samplist[client_data->
+1 −1
Original line number Diff line number Diff line
@@ -1741,9 +1741,9 @@ static void smi_gyro_input_destroy(struct smi_gyro_client_data *client_data)
static void store_gyro_boot_sample(struct smi_gyro_client_data *client_data,
			int x, int y, int z, struct timespec ts)
{
	mutex_lock(&client_data->gyro_sensor_buff);
	if (false == client_data->gyro_buffer_smi130_samples)
		return;
	mutex_lock(&client_data->gyro_sensor_buff);
	if (ts.tv_sec <  client_data->max_buffer_time) {
		if (client_data->gyro_bufsample_cnt < SMI_GYRO_MAXSAMPLE) {
			client_data->smi130_gyro_samplist[client_data->