Commit 740c1c84 authored by Yang Yingliang's avatar Yang Yingliang Committed by Mark Brown

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: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://patch.msgid.link/20240910022618.1397-8-yangyingliang@huaweicloud.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5b2e4d15
...@@ -2934,21 +2934,10 @@ static struct class spi_master_class = { ...@@ -2934,21 +2934,10 @@ static struct class spi_master_class = {
#ifdef CONFIG_SPI_SLAVE #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 * controller
* @spi: device used for the current transfer * @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) int spi_target_abort(struct spi_device *spi)
{ {
struct spi_controller *ctlr = spi->controller; struct spi_controller *ctlr = spi->controller;
......
...@@ -498,7 +498,6 @@ extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 ch ...@@ -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. * controller has native support for memory like operations.
* @mem_caps: controller capabilities for the handling of memory operations. * @mem_caps: controller capabilities for the handling of memory operations.
* @unprepare_message: undo any work done by prepare_message(). * @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 * @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 * @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 * number. Any individual value may be NULL for CS lines that
...@@ -725,10 +724,7 @@ struct spi_controller { ...@@ -725,10 +724,7 @@ struct spi_controller {
struct spi_message *message); struct spi_message *message);
int (*unprepare_message)(struct spi_controller *ctlr, int (*unprepare_message)(struct spi_controller *ctlr,
struct spi_message *message); struct spi_message *message);
union { int (*target_abort)(struct spi_controller *ctlr);
int (*slave_abort)(struct spi_controller *ctlr);
int (*target_abort)(struct spi_controller *ctlr);
};
/* /*
* These hooks are for drivers that use a generic implementation * These hooks are for drivers that use a generic implementation
...@@ -802,11 +798,6 @@ static inline void spi_controller_put(struct spi_controller *ctlr) ...@@ -802,11 +798,6 @@ static inline void spi_controller_put(struct spi_controller *ctlr)
put_device(&ctlr->dev); 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) static inline bool spi_controller_is_target(struct spi_controller *ctlr)
{ {
return IS_ENABLED(CONFIG_SPI_SLAVE) && ctlr->target; 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, ...@@ -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_setup(struct spi_device *spi);
extern int spi_async(struct spi_device *spi, struct spi_message *message); 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); extern int spi_target_abort(struct spi_device *spi);
static inline size_t static inline size_t
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment