summaryrefslogtreecommitdiff
path: root/include/linux/spi
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2024-06-23 13:14:18 +0100
committerMark Brown <broonie@kernel.org>2024-06-23 13:14:18 +0100
commit17436001a6bc42c7f55dc547ca5b1a873208d91d (patch)
tree186b872edc5080b90ef1f8fb88f774d4f242775f /include/linux/spi
parent5d0c35feea339e4a3a9c9e99731e4d49ad5ee329 (diff)
parentd4a0055fdc22381fa256e345095e88d134e354c5 (diff)
spi: add devm_spi_optimize_message() helper
Merge series 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.
Diffstat (limited to 'include/linux/spi')
-rw-r--r--include/linux/spi/spi.h2
1 files changed, 2 insertions, 0 deletions
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);