* [PATCH] mfd: ocelot-spi: Use spi_sync_transfer()
@ 2024-04-04 19:25 Christophe JAILLET
2024-04-04 19:38 ` Colin Foster
2024-04-11 12:50 ` (subset) " Lee Jones
0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2024-04-04 19:25 UTC (permalink / raw
To: Colin Foster, Lee Jones; +Cc: linux-kernel, kernel-janitors, Christophe JAILLET
Use spi_sync_transfer() instead of hand-writing it.
It is less verbose.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/mfd/ocelot-spi.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/mfd/ocelot-spi.c b/drivers/mfd/ocelot-spi.c
index 94f82677675b..b015c8683f1b 100644
--- a/drivers/mfd/ocelot-spi.c
+++ b/drivers/mfd/ocelot-spi.c
@@ -145,7 +145,6 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
struct device *dev = context;
struct ocelot_ddata *ddata;
struct spi_device *spi;
- struct spi_message msg;
unsigned int index = 0;
ddata = dev_get_drvdata(dev);
@@ -166,9 +165,7 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
xfers[index].len = val_size;
index++;
- spi_message_init_with_transfers(&msg, xfers, index);
-
- return spi_sync(spi, &msg);
+ return spi_sync_transfer(spi, xfers, index);
}
static int ocelot_spi_regmap_bus_write(void *context, const void *data, size_t count)
--
2.44.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mfd: ocelot-spi: Use spi_sync_transfer()
2024-04-04 19:25 [PATCH] mfd: ocelot-spi: Use spi_sync_transfer() Christophe JAILLET
@ 2024-04-04 19:38 ` Colin Foster
2024-04-11 12:50 ` (subset) " Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Colin Foster @ 2024-04-04 19:38 UTC (permalink / raw
To: Christophe JAILLET; +Cc: Lee Jones, linux-kernel, kernel-janitors
On Thu, Apr 04, 2024 at 09:25:09PM +0200, Christophe JAILLET wrote:
> Use spi_sync_transfer() instead of hand-writing it.
> It is less verbose.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/mfd/ocelot-spi.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/mfd/ocelot-spi.c b/drivers/mfd/ocelot-spi.c
> index 94f82677675b..b015c8683f1b 100644
> --- a/drivers/mfd/ocelot-spi.c
> +++ b/drivers/mfd/ocelot-spi.c
> @@ -145,7 +145,6 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
> struct device *dev = context;
> struct ocelot_ddata *ddata;
> struct spi_device *spi;
> - struct spi_message msg;
> unsigned int index = 0;
>
> ddata = dev_get_drvdata(dev);
> @@ -166,9 +165,7 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
> xfers[index].len = val_size;
> index++;
>
> - spi_message_init_with_transfers(&msg, xfers, index);
> -
> - return spi_sync(spi, &msg);
> + return spi_sync_transfer(spi, xfers, index);
> }
>
Thanks! I am fighting an unrelated SPI regression, so I tested against 6.7
Reviewed-by: Colin Foster <colin.foster@in-advantage.com>
Tested-by: Colin Foster <colin.foster@in-advantage.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: (subset) [PATCH] mfd: ocelot-spi: Use spi_sync_transfer()
2024-04-04 19:25 [PATCH] mfd: ocelot-spi: Use spi_sync_transfer() Christophe JAILLET
2024-04-04 19:38 ` Colin Foster
@ 2024-04-11 12:50 ` Lee Jones
1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2024-04-11 12:50 UTC (permalink / raw
To: Colin Foster, Lee Jones, Christophe JAILLET; +Cc: linux-kernel, kernel-janitors
On Thu, 04 Apr 2024 21:25:09 +0200, Christophe JAILLET wrote:
> Use spi_sync_transfer() instead of hand-writing it.
> It is less verbose.
>
>
Applied, thanks!
[1/1] mfd: ocelot-spi: Use spi_sync_transfer()
commit: 1947c079bb1b78d3c2784ce99133fc046de6dbf6
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-11 12:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-04 19:25 [PATCH] mfd: ocelot-spi: Use spi_sync_transfer() Christophe JAILLET
2024-04-04 19:38 ` Colin Foster
2024-04-11 12:50 ` (subset) " Lee Jones
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).