Skip to content

Commit 740c1c8

Browse files
Yang Yingliangbroonie
authored andcommitted
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>
1 parent 5b2e4d1 commit 740c1c8

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

drivers/spi/spi.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2934,21 +2934,10 @@ static struct class spi_master_class = {
29342934

29352935
#ifdef CONFIG_SPI_SLAVE
29362936
/**
2937-
* spi_slave_abort - abort the ongoing transfer request on an SPI slave
2937+
* spi_target_abort - abort the ongoing transfer request on an SPI slave
29382938
* controller
29392939
* @spi: device used for the current transfer
29402940
*/
2941-
int spi_slave_abort(struct spi_device *spi)
2942-
{
2943-
struct spi_controller *ctlr = spi->controller;
2944-
2945-
if (spi_controller_is_slave(ctlr) && ctlr->slave_abort)
2946-
return ctlr->slave_abort(ctlr);
2947-
2948-
return -ENOTSUPP;
2949-
}
2950-
EXPORT_SYMBOL_GPL(spi_slave_abort);
2951-
29522941
int spi_target_abort(struct spi_device *spi)
29532942
{
29542943
struct spi_controller *ctlr = spi->controller;

include/linux/spi/spi.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 ch
498498
* controller has native support for memory like operations.
499499
* @mem_caps: controller capabilities for the handling of memory operations.
500500
* @unprepare_message: undo any work done by prepare_message().
501-
* @slave_abort: abort the ongoing transfer request on an SPI slave controller
502501
* @target_abort: abort the ongoing transfer request on an SPI target controller
503502
* @cs_gpiods: Array of GPIO descriptors to use as chip select lines; one per CS
504503
* number. Any individual value may be NULL for CS lines that
@@ -725,10 +724,7 @@ struct spi_controller {
725724
struct spi_message *message);
726725
int (*unprepare_message)(struct spi_controller *ctlr,
727726
struct spi_message *message);
728-
union {
729-
int (*slave_abort)(struct spi_controller *ctlr);
730-
int (*target_abort)(struct spi_controller *ctlr);
731-
};
727+
int (*target_abort)(struct spi_controller *ctlr);
732728

733729
/*
734730
* These hooks are for drivers that use a generic implementation
@@ -802,11 +798,6 @@ static inline void spi_controller_put(struct spi_controller *ctlr)
802798
put_device(&ctlr->dev);
803799
}
804800

805-
static inline bool spi_controller_is_slave(struct spi_controller *ctlr)
806-
{
807-
return IS_ENABLED(CONFIG_SPI_SLAVE) && ctlr->slave;
808-
}
809-
810801
static inline bool spi_controller_is_target(struct spi_controller *ctlr)
811802
{
812803
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,
12961287

12971288
extern int spi_setup(struct spi_device *spi);
12981289
extern int spi_async(struct spi_device *spi, struct spi_message *message);
1299-
extern int spi_slave_abort(struct spi_device *spi);
13001290
extern int spi_target_abort(struct spi_device *spi);
13011291

13021292
static inline size_t

0 commit comments

Comments
 (0)