mbox series

[0/3] spi: add devm_spi_optimize_message() helper

Message ID 20240621-devm_spi_optimize_message-v1-0-3f9dcba6e95e@baylibre.com (mailing list archive)
Headers show
Series spi: add devm_spi_optimize_message() helper | expand

Message

David Lechner June 21, 2024, 8:51 p.m. UTC
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 (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

Comments

Jonathan Cameron June 23, 2024, 10:15 a.m. UTC | #1
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
Mark Brown June 23, 2024, 4:47 p.m. UTC | #2
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
Mark Brown June 23, 2024, 5:20 p.m. UTC | #3
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(+)
Jonathan Cameron June 24, 2024, 7:39 p.m. UTC | #4
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(+)
Jonathan Cameron June 24, 2024, 7:43 p.m. UTC | #5
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(+)  
>