]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
spi: remove {devm_}spi_alloc_master/slave()
authorYang Yingliang <yangyingliang@huawei.com>
Mon, 2 Sep 2024 12:59:47 +0000 (20:59 +0800)
committerMark Brown <broonie@kernel.org>
Sun, 29 Sep 2024 23:12:07 +0000 (01:12 +0200)
All the {devm_}spi_alloc_master/slave() have been replaced,
so they can be removed and replaced in doc and comment.

No functional changed.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://patch.msgid.link/20240902125947.1368-8-yangyingliang@huaweicloud.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Documentation/driver-api/driver-model/devres.rst
drivers/spi/spi.c
include/linux/spi/spi.h

index 5f2ee8d717b1deafb43a60b03dbc5d5bc6b4875a..ebbf8e4cc85fbaddc485099f626d6631dac6d5d5 100644 (file)
@@ -462,8 +462,8 @@ SLAVE DMA ENGINE
   devm_acpi_dma_controller_free()
 
 SPI
-  devm_spi_alloc_master()
-  devm_spi_alloc_slave()
+  devm_spi_alloc_host()
+  devm_spi_alloc_target()
   devm_spi_optimize_message()
   devm_spi_register_controller()
   devm_spi_register_host()
index c1dad30a4528b76211c5cd0ab102557899efe23d..073ffae97767329cc7fd31e93ee3b37d67b6d070 100644 (file)
@@ -3238,9 +3238,9 @@ static int spi_controller_id_alloc(struct spi_controller *ctlr, int start, int e
 }
 
 /**
- * spi_register_controller - register SPI master or slave controller
- * @ctlr: initialized master, originally from spi_alloc_master() or
- *     spi_alloc_slave()
+ * spi_register_controller - register SPI host or target controller
+ * @ctlr: initialized controller, originally from spi_alloc_host() or
+ *     spi_alloc_target()
  * Context: can sleep
  *
  * SPI controllers connect to their drivers using some non-SPI bus,
@@ -3390,11 +3390,11 @@ static void devm_spi_unregister(struct device *dev, void *res)
 }
 
 /**
- * devm_spi_register_controller - register managed SPI master or slave
+ * devm_spi_register_controller - register managed SPI host or target
  *     controller
  * @dev:    device managing SPI controller
- * @ctlr: initialized controller, originally from spi_alloc_master() or
- *     spi_alloc_slave()
+ * @ctlr: initialized controller, originally from spi_alloc_host() or
+ *     spi_alloc_target()
  * Context: can sleep
  *
  * Register a SPI device as with spi_register_controller() which will
@@ -3478,7 +3478,7 @@ void spi_unregister_controller(struct spi_controller *ctlr)
 
        /*
         * Release the last reference on the controller if its driver
-        * has not yet been converted to devm_spi_alloc_master/slave().
+        * has not yet been converted to devm_spi_alloc_host/target().
         */
        if (!ctlr->devm_allocated)
                put_device(&ctlr->dev);
index 4b95663163e0b2a5fb5e3d5b5af3db4a863b9c00..8497f4747e24d4ecd85b74f49609ac1c82c73535 100644 (file)
@@ -824,21 +824,6 @@ void spi_take_timestamp_post(struct spi_controller *ctlr,
 extern struct spi_controller *__spi_alloc_controller(struct device *host,
                                                unsigned int size, bool slave);
 
-static inline struct spi_controller *spi_alloc_master(struct device *host,
-                                                     unsigned int size)
-{
-       return __spi_alloc_controller(host, size, false);
-}
-
-static inline struct spi_controller *spi_alloc_slave(struct device *host,
-                                                    unsigned int size)
-{
-       if (!IS_ENABLED(CONFIG_SPI_SLAVE))
-               return NULL;
-
-       return __spi_alloc_controller(host, size, true);
-}
-
 static inline struct spi_controller *spi_alloc_host(struct device *dev,
                                                    unsigned int size)
 {
@@ -858,21 +843,6 @@ 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);
-}
-
 static inline struct spi_controller *devm_spi_alloc_host(struct device *dev,
                                                         unsigned int size)
 {