RE: [PATCH 7/7] iio:accel:stk8312: drop local buffer

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

 



> -----Original Message-----
> From: linux-iio-owner@xxxxxxxxxxxxxxx [mailto:linux-iio-
> owner@xxxxxxxxxxxxxxx] On Behalf Of Hartmut Knaack
> Sent: Tuesday, July 28, 2015 1:49 AM
> To: linux-iio@xxxxxxxxxxxxxxx
> Cc: Jonathan Cameron; Lars-Peter Clausen; Peter Meerwald; Breana, Tiberiu
> A
> Subject: [PATCH 7/7] iio:accel:stk8312: drop local buffer
> 
> Drop the local buffer in stk8312_trigger_handler() and use data-buffer
> instead for bulk reads.
> 
> Signed-off-by: Hartmut Knaack <knaack.h@xxxxxx>

+1

Reviewed-by: Tiberiu Breana <tiberiu.a.breana@xxxxxxxxx>

> ---
>  drivers/iio/accel/stk8312.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/accel/stk8312.c b/drivers/iio/accel/stk8312.c index
> b059a6cabfbb..a6b2bda7a63c 100644
> --- a/drivers/iio/accel/stk8312.c
> +++ b/drivers/iio/accel/stk8312.c
> @@ -430,7 +430,6 @@ static irqreturn_t stk8312_trigger_handler(int irq, void
> *p)
>  	struct iio_dev *indio_dev = pf->indio_dev;
>  	struct stk8312_data *data = iio_priv(indio_dev);
>  	int bit, ret, i = 0;
> -	u8 buffer[STK8312_ALL_CHANNEL_SIZE];
> 
>  	mutex_lock(&data->lock);
>  	/*
> @@ -441,15 +440,12 @@ static irqreturn_t stk8312_trigger_handler(int irq,
> void *p)
>  		ret = i2c_smbus_read_i2c_block_data(data->client,
>  						    STK8312_REG_XOUT,
> 
> STK8312_ALL_CHANNEL_SIZE,
> -						    buffer);
> +						    data->buffer);
>  		if (ret < STK8312_ALL_CHANNEL_SIZE) {
>  			dev_err(&data->client->dev, "register read
> failed\n");
>  			mutex_unlock(&data->lock);
>  			goto err;
>  		}
> -		data->buffer[0] = buffer[0];
> -		data->buffer[1] = buffer[1];
> -		data->buffer[2] = buffer[2];
>  	} else {
>  		for_each_set_bit(bit, indio_dev->active_scan_mask,
>  				 indio_dev->masklength) {
> --
> 2.4.6
> 
> --
> 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
--
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