summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2024-03-24 13:36:16 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-03-28 13:22:15 +0000
commit86156cadbeff81c194e18e78c23585a8aa673abc (patch)
tree61a4d3fe480b5eec28907da42e5a32affd96663f
parent905908546cb883079971b7e150537d260df64f00 (diff)
downloadlinux-stable-86156cadbeff81c194e18e78c23585a8aa673abc.tar.gz
linux-stable-86156cadbeff81c194e18e78c23585a8aa673abc.tar.bz2
linux-stable-86156cadbeff81c194e18e78c23585a8aa673abc.zip
iio: pressure: hsc030pa: Use spi_read()
Use spi_read() instead of hand-writing it. It is less verbose. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/8327ac591d244ac85aa83c01e559076159c7ba12.1711283728.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/pressure/hsc030pa_spi.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/iio/pressure/hsc030pa_spi.c b/drivers/iio/pressure/hsc030pa_spi.c
index 818fa6303454..337eecc577d2 100644
--- a/drivers/iio/pressure/hsc030pa_spi.c
+++ b/drivers/iio/pressure/hsc030pa_spi.c
@@ -23,14 +23,9 @@
static int hsc_spi_recv(struct hsc_data *data)
{
struct spi_device *spi = to_spi_device(data->dev);
- struct spi_transfer xfer = {
- .tx_buf = NULL,
- .rx_buf = data->buffer,
- .len = HSC_REG_MEASUREMENT_RD_SIZE,
- };
msleep_interruptible(HSC_RESP_TIME_MS);
- return spi_sync_transfer(spi, &xfer, 1);
+ return spi_read(spi, data->buffer, HSC_REG_MEASUREMENT_RD_SIZE);
}
static int hsc_spi_probe(struct spi_device *spi)