* [PATCH 1/3] Documentation: devres: add missing SPI helpers
2024-06-21 20:51 [PATCH 0/3] spi: add devm_spi_optimize_message() helper David Lechner
@ 2024-06-21 20:51 ` David Lechner
2024-06-21 20:51 ` [PATCH 2/3] spi: add devm_spi_optimize_message() helper David Lechner
` (4 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: David Lechner @ 2024-06-21 20:51 UTC (permalink / raw)
To: Mark Brown, Jonathan Cameron
Cc: David Lechner, Michael Hennerich, Nuno Sá, Marcelo Schmitt,
Jonathan Corbet, linux-doc, linux-kernel, linux-spi, linux-iio
A few SPI devm_* helpers were missing from the devres documentation.
This patch adds them.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
Documentation/driver-api/driver-model/devres.rst | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index 18caebad7376..a1c17bcae68d 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -465,6 +465,8 @@ SPI
devm_spi_alloc_master()
devm_spi_alloc_slave()
devm_spi_register_controller()
+ devm_spi_register_host()
+ devm_spi_register_target()
WATCHDOG
devm_watchdog_register_device()
--
2.45.2
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 2/3] spi: add devm_spi_optimize_message() helper
2024-06-21 20:51 [PATCH 0/3] spi: add devm_spi_optimize_message() helper David Lechner
2024-06-21 20:51 ` [PATCH 1/3] Documentation: devres: add missing SPI helpers David Lechner
@ 2024-06-21 20:51 ` David Lechner
2024-06-24 19:44 ` Jonathan Cameron
2024-06-21 20:51 ` [PATCH 3/3] iio: adc: ad7944: use devm_spi_optimize_message() David Lechner
` (3 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: David Lechner @ 2024-06-21 20:51 UTC (permalink / raw)
To: Mark Brown, Jonathan Cameron
Cc: David Lechner, Michael Hennerich, Nuno Sá, Marcelo Schmitt,
Jonathan Corbet, linux-doc, linux-kernel, linux-spi, linux-iio
This adds a new helper function devm_spi_optimize_message() that
automatically registers spi_unoptimize_message() to be called
when the device is removed.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
Documentation/driver-api/driver-model/devres.rst | 1 +
drivers/spi/spi.c | 27 ++++++++++++++++++++++++
include/linux/spi/spi.h | 2 ++
3 files changed, 30 insertions(+)
diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
index a1c17bcae68d..ac9ee7441887 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
@@ -464,6 +464,7 @@ SLAVE DMA ENGINE
SPI
devm_spi_alloc_master()
devm_spi_alloc_slave()
+ devm_spi_optimize_message()
devm_spi_register_controller()
devm_spi_register_host()
devm_spi_register_target()
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 54cbe652a4df..3f953504244b 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -4358,6 +4358,33 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
return ctlr->transfer(spi, message);
}
+static void devm_spi_unoptimize_message(void *msg)
+{
+ spi_unoptimize_message(msg);
+}
+
+/**
+ * devm_spi_optimize_message - managed version of spi_optimize_message()
+ * @dev: the device that manages @msg (usually @spi->dev)
+ * @spi: the device that will be used for the message
+ * @msg: the message to optimize
+ * Return: zero on success, else a negative error code
+ *
+ * spi_unoptimize_message() will automatically be called when the device is
+ * removed.
+ */
+int devm_spi_optimize_message(struct device *dev, struct spi_device *spi,
+ struct spi_message *msg)
+{
+ int ret;
+
+ ret = spi_optimize_message(spi, msg);
+ if (ret)
+ return ret;
+
+ return devm_add_action_or_reset(dev, devm_spi_unoptimize_message, msg);
+}
+
/**
* spi_async - asynchronous SPI transfer
* @spi: device with which data will be exchanged
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 85785bcd20c1..a9388714e7e7 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -1272,6 +1272,8 @@ static inline void spi_message_free(struct spi_message *m)
extern int spi_optimize_message(struct spi_device *spi, struct spi_message *msg);
extern void spi_unoptimize_message(struct spi_message *msg);
+extern int devm_spi_optimize_message(struct device *dev, struct spi_device *spi,
+ struct spi_message *msg);
extern int spi_setup(struct spi_device *spi);
extern int spi_async(struct spi_device *spi, struct spi_message *message);
--
2.45.2
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 2/3] spi: add devm_spi_optimize_message() helper
2024-06-21 20:51 ` [PATCH 2/3] spi: add devm_spi_optimize_message() helper David Lechner
@ 2024-06-24 19:44 ` Jonathan Cameron
0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2024-06-24 19:44 UTC (permalink / raw)
To: David Lechner
Cc: Mark Brown, Michael Hennerich, Nuno Sá, Marcelo Schmitt,
Jonathan Corbet, linux-doc, linux-kernel, linux-spi, linux-iio
On Fri, 21 Jun 2024 15:51:31 -0500
David Lechner <dlechner@baylibre.com> wrote:
> This adds a new helper function devm_spi_optimize_message() that
> automatically registers spi_unoptimize_message() to be called
> when the device is removed.
>
> Signed-off-by: David Lechner <dlechner@baylibre.com>
The new function can be called from modules and doesn't have an
EXPORT_SYMBOL_GPL()
I failed to spot this but a build test immediately noticed!
Jonathan
> ---
> Documentation/driver-api/driver-model/devres.rst | 1 +
> drivers/spi/spi.c | 27 ++++++++++++++++++++++++
> include/linux/spi/spi.h | 2 ++
> 3 files changed, 30 insertions(+)
>
> diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
> index a1c17bcae68d..ac9ee7441887 100644
> --- a/Documentation/driver-api/driver-model/devres.rst
> +++ b/Documentation/driver-api/driver-model/devres.rst
> @@ -464,6 +464,7 @@ SLAVE DMA ENGINE
> SPI
> devm_spi_alloc_master()
> devm_spi_alloc_slave()
> + devm_spi_optimize_message()
> devm_spi_register_controller()
> devm_spi_register_host()
> devm_spi_register_target()
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 54cbe652a4df..3f953504244b 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -4358,6 +4358,33 @@ static int __spi_async(struct spi_device *spi, struct spi_message *message)
> return ctlr->transfer(spi, message);
> }
>
> +static void devm_spi_unoptimize_message(void *msg)
> +{
> + spi_unoptimize_message(msg);
> +}
> +
> +/**
> + * devm_spi_optimize_message - managed version of spi_optimize_message()
> + * @dev: the device that manages @msg (usually @spi->dev)
> + * @spi: the device that will be used for the message
> + * @msg: the message to optimize
> + * Return: zero on success, else a negative error code
> + *
> + * spi_unoptimize_message() will automatically be called when the device is
> + * removed.
> + */
> +int devm_spi_optimize_message(struct device *dev, struct spi_device *spi,
> + struct spi_message *msg)
> +{
> + int ret;
> +
> + ret = spi_optimize_message(spi, msg);
> + if (ret)
> + return ret;
> +
> + return devm_add_action_or_reset(dev, devm_spi_unoptimize_message, msg);
> +}
Missing an export.
> +
> /**
> * spi_async - asynchronous SPI transfer
> * @spi: device with which data will be exchanged
> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
> index 85785bcd20c1..a9388714e7e7 100644
> --- a/include/linux/spi/spi.h
> +++ b/include/linux/spi/spi.h
> @@ -1272,6 +1272,8 @@ static inline void spi_message_free(struct spi_message *m)
>
> extern int spi_optimize_message(struct spi_device *spi, struct spi_message *msg);
> extern void spi_unoptimize_message(struct spi_message *msg);
> +extern int devm_spi_optimize_message(struct device *dev, struct spi_device *spi,
> + struct spi_message *msg);
>
> extern int spi_setup(struct spi_device *spi);
> extern int spi_async(struct spi_device *spi, struct spi_message *message);
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/3] iio: adc: ad7944: use devm_spi_optimize_message()
2024-06-21 20:51 [PATCH 0/3] spi: add devm_spi_optimize_message() helper David Lechner
2024-06-21 20:51 ` [PATCH 1/3] Documentation: devres: add missing SPI helpers David Lechner
2024-06-21 20:51 ` [PATCH 2/3] spi: add devm_spi_optimize_message() helper David Lechner
@ 2024-06-21 20:51 ` David Lechner
2024-06-23 10:15 ` [PATCH 0/3] spi: add devm_spi_optimize_message() helper Jonathan Cameron
` (2 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: David Lechner @ 2024-06-21 20:51 UTC (permalink / raw)
To: Mark Brown, Jonathan Cameron
Cc: David Lechner, Michael Hennerich, Nuno Sá, Marcelo Schmitt,
Jonathan Corbet, linux-doc, linux-kernel, linux-spi, linux-iio
Use new devm_spi_optimize_message() helper to simplify repeated code
in the ad7944 driver.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
drivers/iio/adc/ad7944.c | 26 +++-----------------------
1 file changed, 3 insertions(+), 23 deletions(-)
diff --git a/drivers/iio/adc/ad7944.c b/drivers/iio/adc/ad7944.c
index 4602ab5ed2a6..a6ac17c13a29 100644
--- a/drivers/iio/adc/ad7944.c
+++ b/drivers/iio/adc/ad7944.c
@@ -134,18 +134,12 @@ AD7944_DEFINE_CHIP_INFO(ad7985, ad7944, 16, 0);
/* fully differential */
AD7944_DEFINE_CHIP_INFO(ad7986, ad7986, 18, 1);
-static void ad7944_unoptimize_msg(void *msg)
-{
- spi_unoptimize_message(msg);
-}
-
static int ad7944_3wire_cs_mode_init_msg(struct device *dev, struct ad7944_adc *adc,
const struct iio_chan_spec *chan)
{
unsigned int t_conv_ns = adc->always_turbo ? adc->timing_spec->turbo_conv_ns
: adc->timing_spec->conv_ns;
struct spi_transfer *xfers = adc->xfers;
- int ret;
/*
* NB: can get better performance from some SPI controllers if we use
@@ -175,11 +169,7 @@ static int ad7944_3wire_cs_mode_init_msg(struct device *dev, struct ad7944_adc *
spi_message_init_with_transfers(&adc->msg, xfers, 3);
- ret = spi_optimize_message(adc->spi, &adc->msg);
- if (ret)
- return ret;
-
- return devm_add_action_or_reset(dev, ad7944_unoptimize_msg, &adc->msg);
+ return devm_spi_optimize_message(dev, adc->spi, &adc->msg);
}
static int ad7944_4wire_mode_init_msg(struct device *dev, struct ad7944_adc *adc,
@@ -188,7 +178,6 @@ static int ad7944_4wire_mode_init_msg(struct device *dev, struct ad7944_adc *adc
unsigned int t_conv_ns = adc->always_turbo ? adc->timing_spec->turbo_conv_ns
: adc->timing_spec->conv_ns;
struct spi_transfer *xfers = adc->xfers;
- int ret;
/*
* NB: can get better performance from some SPI controllers if we use
@@ -209,11 +198,7 @@ static int ad7944_4wire_mode_init_msg(struct device *dev, struct ad7944_adc *adc
spi_message_init_with_transfers(&adc->msg, xfers, 2);
- ret = spi_optimize_message(adc->spi, &adc->msg);
- if (ret)
- return ret;
-
- return devm_add_action_or_reset(dev, ad7944_unoptimize_msg, &adc->msg);
+ return devm_spi_optimize_message(dev, adc->spi, &adc->msg);
}
static int ad7944_chain_mode_init_msg(struct device *dev, struct ad7944_adc *adc,
@@ -221,7 +206,6 @@ static int ad7944_chain_mode_init_msg(struct device *dev, struct ad7944_adc *adc
u32 n_chain_dev)
{
struct spi_transfer *xfers = adc->xfers;
- int ret;
/*
* NB: SCLK has to be low before we toggle CS to avoid triggering the
@@ -249,11 +233,7 @@ static int ad7944_chain_mode_init_msg(struct device *dev, struct ad7944_adc *adc
spi_message_init_with_transfers(&adc->msg, xfers, 2);
- ret = spi_optimize_message(adc->spi, &adc->msg);
- if (ret)
- return ret;
-
- return devm_add_action_or_reset(dev, ad7944_unoptimize_msg, &adc->msg);
+ return devm_spi_optimize_message(dev, adc->spi, &adc->msg);
}
/**
--
2.45.2
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 0/3] spi: add devm_spi_optimize_message() helper
2024-06-21 20:51 [PATCH 0/3] spi: add devm_spi_optimize_message() helper David Lechner
` (2 preceding siblings ...)
2024-06-21 20:51 ` [PATCH 3/3] iio: adc: ad7944: use devm_spi_optimize_message() David Lechner
@ 2024-06-23 10:15 ` Jonathan Cameron
2024-06-23 16:47 ` (subset) " Mark Brown
2024-06-23 17:20 ` Mark Brown
5 siblings, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2024-06-23 10:15 UTC (permalink / raw)
To: David Lechner
Cc: Mark Brown, Michael Hennerich, Nuno Sá, Marcelo Schmitt,
Jonathan Corbet, linux-doc, linux-kernel, linux-spi, linux-iio
On Fri, 21 Jun 2024 15:51:29 -0500
David Lechner <dlechner@baylibre.com> wrote:
> In the IIO subsystem, we are finding that it is common to call
> spi_optimize_message() during driver probe since the SPI message
> doesn't change for the lifetime of the driver. This patch adds a
> devm_spi_optimize_message() helper to simplify this common pattern.
Looks good to me. Obviously I need Mark's ack or an immutable
branch to pick these up though.
Thanks
Jonathan
>
> ---
> David Lechner (3):
> Documentation: devres: add missing SPI helpers
> spi: add devm_spi_optimize_message() helper
> iio: adc: ad7944: use devm_spi_optimize_message()
>
> Documentation/driver-api/driver-model/devres.rst | 3 +++
> drivers/iio/adc/ad7944.c | 26 +++--------------------
> drivers/spi/spi.c | 27 ++++++++++++++++++++++++
> include/linux/spi/spi.h | 2 ++
> 4 files changed, 35 insertions(+), 23 deletions(-)
> ---
> base-commit: 0ca645ab5b1528666f6662a0e620140355b5aea3
> change-id: 20240621-devm_spi_optimize_message-ebbde029dd7a
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: (subset) [PATCH 0/3] spi: add devm_spi_optimize_message() helper
2024-06-21 20:51 [PATCH 0/3] spi: add devm_spi_optimize_message() helper David Lechner
` (3 preceding siblings ...)
2024-06-23 10:15 ` [PATCH 0/3] spi: add devm_spi_optimize_message() helper Jonathan Cameron
@ 2024-06-23 16:47 ` Mark Brown
2024-06-23 17:20 ` Mark Brown
5 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2024-06-23 16:47 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner
Cc: Michael Hennerich, Nuno Sá, Marcelo Schmitt, Jonathan Corbet,
linux-doc, linux-kernel, linux-spi, linux-iio
On Fri, 21 Jun 2024 15:51:29 -0500, David Lechner wrote:
> In the IIO subsystem, we are finding that it is common to call
> spi_optimize_message() during driver probe since the SPI message
> doesn't change for the lifetime of the driver. This patch adds a
> devm_spi_optimize_message() helper to simplify this common pattern.
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/3] Documentation: devres: add missing SPI helpers
commit: 9b894d65e9788ece0d51e76d2c184524900f5ec9
[2/3] spi: add devm_spi_optimize_message() helper
commit: 17436001a6bc42c7f55dc547ca5b1a873208d91d
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 0/3] spi: add devm_spi_optimize_message() helper
2024-06-21 20:51 [PATCH 0/3] spi: add devm_spi_optimize_message() helper David Lechner
` (4 preceding siblings ...)
2024-06-23 16:47 ` (subset) " Mark Brown
@ 2024-06-23 17:20 ` Mark Brown
2024-06-24 19:39 ` Jonathan Cameron
5 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2024-06-23 17:20 UTC (permalink / raw)
To: David Lechner
Cc: Jonathan Cameron, Michael Hennerich, Nuno Sá,
Marcelo Schmitt, Jonathan Corbet, linux-doc, linux-kernel,
linux-spi, linux-iio
[-- Attachment #1: Type: text/plain, Size: 1597 bytes --]
On Fri, Jun 21, 2024 at 03:51:29PM -0500, David Lechner wrote:
> In the IIO subsystem, we are finding that it is common to call
> spi_optimize_message() during driver probe since the SPI message
> doesn't change for the lifetime of the driver. This patch adds a
> devm_spi_optimize_message() helper to simplify this common pattern.
The following changes since commit 6ba59ff4227927d3a8530fc2973b80e94b54d58f:
Linux 6.10-rc4 (2024-06-16 13:40:16 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git tags/spi-devm-optimize
for you to fetch changes up to d4a0055fdc22381fa256e345095e88d134e354c5:
spi: add devm_spi_optimize_message() helper (2024-06-22 12:14:33 +0100)
----------------------------------------------------------------
spi: add devm_spi_optimize_message() helper
Helper from David Lechner <dlechner@baylibre.com>:
In the IIO subsystem, we are finding that it is common to call
spi_optimize_message() during driver probe since the SPI message
doesn't change for the lifetime of the driver. This patch adds a
devm_spi_optimize_message() helper to simplify this common pattern.
----------------------------------------------------------------
David Lechner (2):
Documentation: devres: add missing SPI helpers
spi: add devm_spi_optimize_message() helper
Documentation/driver-api/driver-model/devres.rst | 3 +++
drivers/spi/spi.c | 27 ++++++++++++++++++++++++
include/linux/spi/spi.h | 2 ++
3 files changed, 32 insertions(+)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 0/3] spi: add devm_spi_optimize_message() helper
2024-06-23 17:20 ` Mark Brown
@ 2024-06-24 19:39 ` Jonathan Cameron
2024-06-24 19:43 ` Jonathan Cameron
0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Cameron @ 2024-06-24 19:39 UTC (permalink / raw)
To: Mark Brown
Cc: David Lechner, Michael Hennerich, Nuno Sá, Marcelo Schmitt,
Jonathan Corbet, linux-doc, linux-kernel, linux-spi, linux-iio
On Sun, 23 Jun 2024 18:20:39 +0100
Mark Brown <broonie@kernel.org> wrote:
> On Fri, Jun 21, 2024 at 03:51:29PM -0500, David Lechner wrote:
> > In the IIO subsystem, we are finding that it is common to call
> > spi_optimize_message() during driver probe since the SPI message
> > doesn't change for the lifetime of the driver. This patch adds a
> > devm_spi_optimize_message() helper to simplify this common pattern.
>
> The following changes since commit 6ba59ff4227927d3a8530fc2973b80e94b54d58f:
>
> Linux 6.10-rc4 (2024-06-16 13:40:16 -0700)
>
> are available in the Git repository at:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git tags/spi-devm-optimize
Thanks. Applied patch 3 on a merge of that tag into the togreg branch
of iio.git which I've pushed out as testing to see if anything went
horribly wrong ;)
Jonathan
>
> for you to fetch changes up to d4a0055fdc22381fa256e345095e88d134e354c5:
>
> spi: add devm_spi_optimize_message() helper (2024-06-22 12:14:33 +0100)
>
> ----------------------------------------------------------------
> spi: add devm_spi_optimize_message() helper
>
> Helper from David Lechner <dlechner@baylibre.com>:
>
> In the IIO subsystem, we are finding that it is common to call
> spi_optimize_message() during driver probe since the SPI message
> doesn't change for the lifetime of the driver. This patch adds a
> devm_spi_optimize_message() helper to simplify this common pattern.
>
> ----------------------------------------------------------------
> David Lechner (2):
> Documentation: devres: add missing SPI helpers
> spi: add devm_spi_optimize_message() helper
>
> Documentation/driver-api/driver-model/devres.rst | 3 +++
> drivers/spi/spi.c | 27 ++++++++++++++++++++++++
> include/linux/spi/spi.h | 2 ++
> 3 files changed, 32 insertions(+)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 0/3] spi: add devm_spi_optimize_message() helper
2024-06-24 19:39 ` Jonathan Cameron
@ 2024-06-24 19:43 ` Jonathan Cameron
0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Cameron @ 2024-06-24 19:43 UTC (permalink / raw)
To: Mark Brown
Cc: David Lechner, Michael Hennerich, Nuno Sá, Marcelo Schmitt,
Jonathan Corbet, linux-doc, linux-kernel, linux-spi, linux-iio
On Mon, 24 Jun 2024 20:39:18 +0100
Jonathan Cameron <jic23@kernel.org> wrote:
> On Sun, 23 Jun 2024 18:20:39 +0100
> Mark Brown <broonie@kernel.org> wrote:
>
> > On Fri, Jun 21, 2024 at 03:51:29PM -0500, David Lechner wrote:
> > > In the IIO subsystem, we are finding that it is common to call
> > > spi_optimize_message() during driver probe since the SPI message
> > > doesn't change for the lifetime of the driver. This patch adds a
> > > devm_spi_optimize_message() helper to simplify this common pattern.
> >
> > The following changes since commit 6ba59ff4227927d3a8530fc2973b80e94b54d58f:
> >
> > Linux 6.10-rc4 (2024-06-16 13:40:16 -0700)
> >
> > are available in the Git repository at:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git tags/spi-devm-optimize
>
> Thanks. Applied patch 3 on a merge of that tag into the togreg branch
> of iio.git which I've pushed out as testing to see if anything went
> horribly wrong ;)
>
Hit send too soon. The new devm_spi_optmize_message() is missing an
EXPORT_SYMBOL_* so my local build test with modules failed.
Jonathan
> Jonathan
>
> >
> > for you to fetch changes up to d4a0055fdc22381fa256e345095e88d134e354c5:
> >
> > spi: add devm_spi_optimize_message() helper (2024-06-22 12:14:33 +0100)
> >
> > ----------------------------------------------------------------
> > spi: add devm_spi_optimize_message() helper
> >
> > Helper from David Lechner <dlechner@baylibre.com>:
> >
> > In the IIO subsystem, we are finding that it is common to call
> > spi_optimize_message() during driver probe since the SPI message
> > doesn't change for the lifetime of the driver. This patch adds a
> > devm_spi_optimize_message() helper to simplify this common pattern.
> >
> > ----------------------------------------------------------------
> > David Lechner (2):
> > Documentation: devres: add missing SPI helpers
> > spi: add devm_spi_optimize_message() helper
> >
> > Documentation/driver-api/driver-model/devres.rst | 3 +++
> > drivers/spi/spi.c | 27 ++++++++++++++++++++++++
> > include/linux/spi/spi.h | 2 ++
> > 3 files changed, 32 insertions(+)
>
^ permalink raw reply [flat|nested] 10+ messages in thread