iio: st_sensors: simplify buffer address handling
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 24 Mar 2016 13:18:03 +0000 (14:18 +0100)
committerJonathan Cameron <jic23@kernel.org>
Mon, 28 Mar 2016 07:51:39 +0000 (08:51 +0100)
commite6e45420f41fc613569e8bb6d15e0472dc0ea1ab
treef31d70478f2f2fd3a1634fe27beb1d3a6e1b86d7
parentd1ef4f2cae6705925088047554e89c34048f926a
iio: st_sensors: simplify buffer address handling

The driver goes to some length to dynamically allocate an array
to hold the channel addresses. However no ST sensor has more than
three channels (x, y, z at most). Instead of kmalloc():ing and
kfree():in the address array, just use a fixed array of three
elements.

Cc: Giuseppe Barba <giuseppe.barba@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/common/st_sensors/st_sensors_buffer.c