summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2015-07-29 23:39:40 +0200
committerJonathan Cameron <jic23@kernel.org>2015-08-08 13:24:58 +0200
commit7a9fbd250ce274a1a625b1e2055abfe26328e46b (patch)
treec9343c3d3d5de17a596100fb95243c871a76018f /drivers/iio
parentiio:accel:stk8312: code style cleanup (diff)
downloadlinux-7a9fbd250ce274a1a625b1e2055abfe26328e46b.tar.xz
linux-7a9fbd250ce274a1a625b1e2055abfe26328e46b.zip
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@gmx.de> Reviewed-by: Tiberiu Breana <tiberiu.a.breana@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/accel/stk8312.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/iio/accel/stk8312.c b/drivers/iio/accel/stk8312.c
index c5a47650b453..c764af284c94 100644
--- a/drivers/iio/accel/stk8312.c
+++ b/drivers/iio/accel/stk8312.c
@@ -435,7 +435,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);
/*
@@ -446,15 +445,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) {