summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Lechner <dlechner@baylibre.com>2024-06-21 15:51:31 -0500
committerMark Brown <broonie@kernel.org>2024-06-22 12:14:33 +0100
commitd4a0055fdc22381fa256e345095e88d134e354c5 (patch)
tree230e9dcb0562b19d66aec08f8e40c9cc0cb55412 /include
parent9b894d65e9788ece0d51e76d2c184524900f5ec9 (diff)
downloadlinux-d4a0055fdc22381fa256e345095e88d134e354c5.tar.gz
linux-d4a0055fdc22381fa256e345095e88d134e354c5.tar.bz2
linux-d4a0055fdc22381fa256e345095e88d134e354c5.zip
spi: add devm_spi_optimize_message() helper
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> Link: https://patch.msgid.link/20240621-devm_spi_optimize_message-v1-2-3f9dcba6e95e@baylibre.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include')
-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 e8e1e798924f..e6e5978f7564 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -1268,6 +1268,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);