summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-10-11 11:22:04 +0200
committerMark Brown <broonie@kernel.org>2022-11-01 19:30:10 +0100
commitb8d3b056a78dcc941fd1a117697ab2b956c2953f (patch)
tree1f796e33734649ccf1468969e16c3c1db070c445 /drivers/spi
parentspi: Update reference to struct spi_controller (diff)
downloadlinux-b8d3b056a78dcc941fd1a117697ab2b956c2953f.tar.xz
linux-b8d3b056a78dcc941fd1a117697ab2b956c2953f.zip
spi: introduce new helpers with using modern naming
For using modern names host/target to instead of all the legacy names, I think it takes 3 steps: - step1: introduce new helpers with modern naming. - step2: switch to use these new helpers in all drivers. - step3: remove all legacy helpers and update all legacy names. This patch is for step1, it introduces new helpers with host/target naming for drivers using. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20221011092204.950288-1-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 8df8b93df1c3..4ddd250481f5 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2771,6 +2771,17 @@ int spi_slave_abort(struct spi_device *spi)
}
EXPORT_SYMBOL_GPL(spi_slave_abort);
+int spi_target_abort(struct spi_device *spi)
+{
+ struct spi_controller *ctlr = spi->controller;
+
+ if (spi_controller_is_target(ctlr) && ctlr->target_abort)
+ return ctlr->target_abort(ctlr);
+
+ return -ENOTSUPP;
+}
+EXPORT_SYMBOL_GPL(spi_target_abort);
+
static ssize_t slave_show(struct device *dev, struct device_attribute *attr,
char *buf)
{