]> asedeno.scripts.mit.edu Git - linux.git/commit
iio: ad7949: fix incorrect SPI xfer len
authorAndrea Merello <andrea.merello@gmail.com>
Thu, 12 Sep 2019 14:43:08 +0000 (16:43 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 21 Sep 2019 17:15:10 +0000 (18:15 +0100)
commit348eb0b2c4f0f912d626fa789dfeb084b083e1f0
tree2a4f85e0a6e631293ce8f8b5e8438d9dae4b1d07
parent0fe2f2b789190661df24bb8bf62294145729a1fe
iio: ad7949: fix incorrect SPI xfer len

This driver supports 14-bits and 16-bits devices. All of them have a 14-bit
configuration registers. All SPI trasfers, for reading AD conversion
results and for writing the configuration register, fit in two bytes.

The driver always uses 4-bytes xfers which seems at least pointless (maybe
even harmful). This patch trims the SPI xfer len and the buffer size to
two bytes.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ad7949.c