Skip to content

Commit 0809a9c

Browse files
Yang Yingliangbroonie
authored andcommitted
spi: remove {devm_}spi_alloc_master/slave()
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 5c30309 commit 0809a9c

File tree

3 files changed

+9
-39
lines changed

3 files changed

+9
-39
lines changed

Documentation/driver-api/driver-model/devres.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ SLAVE DMA ENGINE
462462
devm_acpi_dma_controller_free()
463463

464464
SPI
465-
devm_spi_alloc_master()
466-
devm_spi_alloc_slave()
465+
devm_spi_alloc_host()
466+
devm_spi_alloc_target()
467467
devm_spi_optimize_message()
468468
devm_spi_register_controller()
469469
devm_spi_register_host()

drivers/spi/spi.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3238,9 +3238,9 @@ static int spi_controller_id_alloc(struct spi_controller *ctlr, int start, int e
32383238
}
32393239

32403240
/**
3241-
* spi_register_controller - register SPI master or slave controller
3242-
* @ctlr: initialized master, originally from spi_alloc_master() or
3243-
* spi_alloc_slave()
3241+
* spi_register_controller - register SPI host or target controller
3242+
* @ctlr: initialized controller, originally from spi_alloc_host() or
3243+
* spi_alloc_target()
32443244
* Context: can sleep
32453245
*
32463246
* 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)
33903390
}
33913391

33923392
/**
3393-
* devm_spi_register_controller - register managed SPI master or slave
3393+
* devm_spi_register_controller - register managed SPI host or target
33943394
* controller
33953395
* @dev: device managing SPI controller
3396-
* @ctlr: initialized controller, originally from spi_alloc_master() or
3397-
* spi_alloc_slave()
3396+
* @ctlr: initialized controller, originally from spi_alloc_host() or
3397+
* spi_alloc_target()
33983398
* Context: can sleep
33993399
*
34003400
* Register a SPI device as with spi_register_controller() which will
@@ -3478,7 +3478,7 @@ void spi_unregister_controller(struct spi_controller *ctlr)
34783478

34793479
/*
34803480
* Release the last reference on the controller if its driver
3481-
* has not yet been converted to devm_spi_alloc_master/slave().
3481+
* has not yet been converted to devm_spi_alloc_host/target().
34823482
*/
34833483
if (!ctlr->devm_allocated)
34843484
put_device(&ctlr->dev);

include/linux/spi/spi.h

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -824,21 +824,6 @@ void spi_take_timestamp_post(struct spi_controller *ctlr,
824824
extern struct spi_controller *__spi_alloc_controller(struct device *host,
825825
unsigned int size, bool slave);
826826

827-
static inline struct spi_controller *spi_alloc_master(struct device *host,
828-
unsigned int size)
829-
{
830-
return __spi_alloc_controller(host, size, false);
831-
}
832-
833-
static inline struct spi_controller *spi_alloc_slave(struct device *host,
834-
unsigned int size)
835-
{
836-
if (!IS_ENABLED(CONFIG_SPI_SLAVE))
837-
return NULL;
838-
839-
return __spi_alloc_controller(host, size, true);
840-
}
841-
842827
static inline struct spi_controller *spi_alloc_host(struct device *dev,
843828
unsigned int size)
844829
{
@@ -858,21 +843,6 @@ struct spi_controller *__devm_spi_alloc_controller(struct device *dev,
858843
unsigned int size,
859844
bool slave);
860845

861-
static inline struct spi_controller *devm_spi_alloc_master(struct device *dev,
862-
unsigned int size)
863-
{
864-
return __devm_spi_alloc_controller(dev, size, false);
865-
}
866-
867-
static inline struct spi_controller *devm_spi_alloc_slave(struct device *dev,
868-
unsigned int size)
869-
{
870-
if (!IS_ENABLED(CONFIG_SPI_SLAVE))
871-
return NULL;
872-
873-
return __devm_spi_alloc_controller(dev, size, true);
874-
}
875-
876846
static inline struct spi_controller *devm_spi_alloc_host(struct device *dev,
877847
unsigned int size)
878848
{

0 commit comments

Comments
 (0)