summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2024-06-30 13:36:58 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-06-30 13:36:58 +0300
commit4f291b30163737103e60bdc7c4d62a7121b0d715 (patch)
tree98e4b71f0307d13f407b7af93cb37c678f6010c2 /include
parentebe061b9cc80dfff68fa6a46d412d85d67b68be3 (diff)
parent7e74a45c7afdd8a9f82d14fd79ae0383bbaaed1e (diff)
downloadlinux-4f291b30163737103e60bdc7c4d62a7121b0d715.tar.xz
Merge tag 'spi-devm-optimize' into togreg
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.
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);