Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Christophe JAILLET and committed by
Jonathan Cameron
86156cad 90590854

+1 -6
+1 -6
drivers/iio/pressure/hsc030pa_spi.c
··· 23 23 static int hsc_spi_recv(struct hsc_data *data) 24 24 { 25 25 struct spi_device *spi = to_spi_device(data->dev); 26 - struct spi_transfer xfer = { 27 - .tx_buf = NULL, 28 - .rx_buf = data->buffer, 29 - .len = HSC_REG_MEASUREMENT_RD_SIZE, 30 - }; 31 26 32 27 msleep_interruptible(HSC_RESP_TIME_MS); 33 - return spi_sync_transfer(spi, &xfer, 1); 28 + return spi_read(spi, data->buffer, HSC_REG_MEASUREMENT_RD_SIZE); 34 29 } 35 30 36 31 static int hsc_spi_probe(struct spi_device *spi)