]> git.baikalelectronics.ru Git - kernel.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)
commitc93dfa9ffb1f89c25ab6e617b9e3d6e9c53ee3b5
tree2a4f85e0a6e631293ce8f8b5e8438d9dae4b1d07
parent1267edc7d645362a60262ba09b35ba2453d256bb
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