iio: pressure: hsc030pa: Use spi_read()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 24 Mar 2024 12:36:16 +0000 (13:36 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 28 Mar 2024 13:22:15 +0000 (13:22 +0000)
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>
drivers/iio/pressure/hsc030pa_spi.c

index 818fa630345450080d2111d5bfc7c36ecb58d81f..337eecc577d2a2c76191c9e86780cfa65da62802 100644 (file)
 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)