Skip to contentSkip to conversation

spi: introduce new helpers with using modern naming

PATCH In review Yang Yingliang 2 participants 3 messages Oct 11, 2022 – Nov 2, 2022 SPI

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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.

---
v1 -> v2:
make 'target' member into union to initialize it.

---
 drivers/spi/spi.c       | 11 ++++++++++
 include/linux/spi/spi.h | 47 +++++++++++++++++++++++++++++++++++++++--
 2 files changed, 56 insertions(+), 2 deletions(-)
drivers/spi/spi.c +11 -0
index 5f9aedd1f0b6..04b5668a1866 100644
@@ -2759,6 +2759,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)
 {
include/linux/spi/spi.h +45 -2

95 lines not on this page · raw message

Signature · 1 line
2.25.1
#1 lore raw

Hi, Mark

Quoted 9 lines · Yang Yingliang

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.

Quoted 9 lines

---
v1 -> v2:
make 'target' member into union to initialize it.

---
  drivers/spi/spi.c       | 11 ++++++++++
  include/linux/spi/spi.h | 47 +++++++++++++++++++++++++++++++++++++++--
  2 files changed, 56 insertions(+), 2 deletions(-)

Does this patch look good to you or do you have any suggestion?

Thanks,
Yang

maintainer
#2 lore raw
In reply to Yang Yingliang
Quoted 10 lines · Yang Yingliang

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.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: introduce new helpers with using modern naming

      commit: b8d3b056a78dcc941fd1a117697ab2b956c2953f

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark