mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
spi: remove spi_controller_is_slave() and spi_slave_abort()
spi_controller_is_slave() and spi_slave_abort() are all replaced, so they can be removed. No functional changed. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://patch.msgid.link/20240910022618.1397-8-yangyingliang@huaweicloud.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
5b2e4d1515
commit
740c1c84bf
@ -2934,21 +2934,10 @@ static struct class spi_master_class = {
|
||||
|
||||
#ifdef CONFIG_SPI_SLAVE
|
||||
/**
|
||||
* spi_slave_abort - abort the ongoing transfer request on an SPI slave
|
||||
* spi_target_abort - abort the ongoing transfer request on an SPI slave
|
||||
* controller
|
||||
* @spi: device used for the current transfer
|
||||
*/
|
||||
int spi_slave_abort(struct spi_device *spi)
|
||||
{
|
||||
struct spi_controller *ctlr = spi->controller;
|
||||
|
||||
if (spi_controller_is_slave(ctlr) && ctlr->slave_abort)
|
||||
return ctlr->slave_abort(ctlr);
|
||||
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(spi_slave_abort);
|
||||
|
||||
int spi_target_abort(struct spi_device *spi)
|
||||
{
|
||||
struct spi_controller *ctlr = spi->controller;
|
||||
|
@ -498,7 +498,6 @@ extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 ch
|
||||
* controller has native support for memory like operations.
|
||||
* @mem_caps: controller capabilities for the handling of memory operations.
|
||||
* @unprepare_message: undo any work done by prepare_message().
|
||||
* @slave_abort: abort the ongoing transfer request on an SPI slave controller
|
||||
* @target_abort: abort the ongoing transfer request on an SPI target controller
|
||||
* @cs_gpiods: Array of GPIO descriptors to use as chip select lines; one per CS
|
||||
* number. Any individual value may be NULL for CS lines that
|
||||
@ -725,10 +724,7 @@ struct spi_controller {
|
||||
struct spi_message *message);
|
||||
int (*unprepare_message)(struct spi_controller *ctlr,
|
||||
struct spi_message *message);
|
||||
union {
|
||||
int (*slave_abort)(struct spi_controller *ctlr);
|
||||
int (*target_abort)(struct spi_controller *ctlr);
|
||||
};
|
||||
int (*target_abort)(struct spi_controller *ctlr);
|
||||
|
||||
/*
|
||||
* These hooks are for drivers that use a generic implementation
|
||||
@ -802,11 +798,6 @@ static inline void spi_controller_put(struct spi_controller *ctlr)
|
||||
put_device(&ctlr->dev);
|
||||
}
|
||||
|
||||
static inline bool spi_controller_is_slave(struct spi_controller *ctlr)
|
||||
{
|
||||
return IS_ENABLED(CONFIG_SPI_SLAVE) && ctlr->slave;
|
||||
}
|
||||
|
||||
static inline bool spi_controller_is_target(struct spi_controller *ctlr)
|
||||
{
|
||||
return IS_ENABLED(CONFIG_SPI_SLAVE) && ctlr->target;
|
||||
@ -1296,7 +1287,6 @@ extern int devm_spi_optimize_message(struct device *dev, struct spi_device *spi,
|
||||
|
||||
extern int spi_setup(struct spi_device *spi);
|
||||
extern int spi_async(struct spi_device *spi, struct spi_message *message);
|
||||
extern int spi_slave_abort(struct spi_device *spi);
|
||||
extern int spi_target_abort(struct spi_device *spi);
|
||||
|
||||
static inline size_t
|
||||
|
Loading…
Reference in New Issue
Block a user