Re: [PATCH] iio: Add Freescale MPL3115A2 pressure / temperature sensor driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> +static irqreturn_t mpl3115_trigger_handler(int irq, void *p)
> +{
> +	struct iio_poll_func *pf = p;
> +	struct iio_dev *indio_dev = pf->indio_dev;
> +	struct mpl3115_data *data = iio_priv(indio_dev);
> +	u8 buf[16]; /* 24-bit channel + 16-bit channel + padding + ts */
> +	int ret, pos = 0;
> +
> +	mutex_lock(&data->lock);
> +	ret = mpl3115_request(data);
> +	if (ret < 0) {
> +		mutex_unlock(&data->lock);
> +		goto done;
> +	}
> +
> +	if (test_bit(0, indio_dev->active_scan_mask)) {
> +		ret = i2c_smbus_read_i2c_block_data(data->client,
> +			MPL3115_OUT_PRESS, 3, &buf[pos]);
> +		if (ret < 0)
> +			goto done;
> +		pos += 3;
> +	}
> +
> +	if (test_bit(1, indio_dev->active_scan_mask)) {
> +		ret = i2c_smbus_read_i2c_block_data(data->client,
> +			MPL3115_OUT_TEMP, 2, &buf[pos]);
> +		if (ret < 0)
> +			goto done;

Are you forgetting here to unlock?

Andi

> +	}
> +	mutex_unlock(&data->lock);
> +
> +	iio_push_to_buffers_with_timestamp(indio_dev, buf,
> +		iio_get_time_ns());
> +
> +done:
> +	iio_trigger_notify_done(indio_dev->trig);
> +	return IRQ_HANDLED;
> +}
--
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




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux