Kernel-Janitors Archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: pressure: hsc030pa: Use spi_read()
@ 2024-03-24 12:36 Christophe JAILLET
  2024-03-24 13:51 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2024-03-24 12:36 UTC (permalink / raw
  To: Petre Rodan, Jonathan Cameron, Lars-Peter Clausen
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-iio

Use spi_read() instead of hand-writing it.
It is less verbose.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile test only
---
 drivers/iio/pressure/hsc030pa_spi.c | 7 +------
 1 file changed, 1 insertion(+), 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)
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: pressure: hsc030pa: Use spi_read()
  2024-03-24 12:36 [PATCH] iio: pressure: hsc030pa: Use spi_read() Christophe JAILLET
@ 2024-03-24 13:51 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2024-03-24 13:51 UTC (permalink / raw
  To: Christophe JAILLET
  Cc: Petre Rodan, Lars-Peter Clausen, linux-kernel, kernel-janitors,
	linux-iio

On Sun, 24 Mar 2024 13:36:16 +0100
Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:

> Use spi_read() instead of hand-writing it.
> It is less verbose.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Applied to the togreg-normal branch of iio.git.

Thanks,

Jonathan

> ---
> Compile test only
> ---
>  drivers/iio/pressure/hsc030pa_spi.c | 7 +------
>  1 file changed, 1 insertion(+), 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)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-24 13:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-24 12:36 [PATCH] iio: pressure: hsc030pa: Use spi_read() Christophe JAILLET
2024-03-24 13:51 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).