diff options
author | Mark Brown <broonie@kernel.org> | 2020-11-27 16:18:32 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-11-27 16:18:32 +0000 |
commit | db4a831997047809229152261a462c17cb857c84 (patch) | |
tree | 526f910ce982f78d44305081545a66d8f5de5887 /include/linux/spi | |
parent | 459ea85049b01708e364c34deac24b00909c73ed (diff) | |
parent | 7218838109fef61cdec988ff728e902d434c9cc5 (diff) | |
download | linux-stable-db4a831997047809229152261a462c17cb857c84.tar.gz linux-stable-db4a831997047809229152261a462c17cb857c84.tar.bz2 linux-stable-db4a831997047809229152261a462c17cb857c84.zip |
Merge branch 'for-5.10' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.11
Diffstat (limited to 'include/linux/spi')
-rw-r--r-- | include/linux/spi/spi.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 8097f27702f3..aa09fdc8042d 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -735,6 +735,25 @@ static inline struct spi_controller *spi_alloc_slave(struct device *host, return __spi_alloc_controller(host, size, true); } +struct spi_controller *__devm_spi_alloc_controller(struct device *dev, + unsigned int size, + bool slave); + +static inline struct spi_controller *devm_spi_alloc_master(struct device *dev, + unsigned int size) +{ + return __devm_spi_alloc_controller(dev, size, false); +} + +static inline struct spi_controller *devm_spi_alloc_slave(struct device *dev, + unsigned int size) +{ + if (!IS_ENABLED(CONFIG_SPI_SLAVE)) + return NULL; + + return __devm_spi_alloc_controller(dev, size, true); +} + extern int spi_register_controller(struct spi_controller *ctlr); extern int devm_spi_register_controller(struct device *dev, struct spi_controller *ctlr); |