diff mbox series

spi: Merge spi_controller.{slave,target}_abort()

Message ID 809c82d54b85dd87ef7ee69fc93016085be85cec.1667555967.git.geert+renesas@glider.be
State Accepted
Commit 6c6871cdaef96361f6b79a3e45d451a6475df4d6
Headers show
Series spi: Merge spi_controller.{slave,target}_abort() | expand

Commit Message

Geert Uytterhoeven Nov. 4, 2022, 10:01 a.m. UTC
Mixing SPI slave/target handlers and SPI slave/target controllers using
legacy and modern naming does not work well: there are now two different
callbacks for aborting a slave/target operation, of which only one is
populated, while spi_{slave,target}_abort() check and use only one,
which may be the unpopulated one.

Fix this by merging the slave/target abort callbacks into a single
callback using a union, like is already done for the slave/target flags.

Fixes: b8d3b056a78dcc94 ("spi: introduce new helpers with using modern naming")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
 include/linux/spi/spi.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Mark Brown Nov. 4, 2022, 3:28 p.m. UTC | #1
On Fri, 4 Nov 2022 11:01:27 +0100, Geert Uytterhoeven wrote:
> Mixing SPI slave/target handlers and SPI slave/target controllers using
> legacy and modern naming does not work well: there are now two different
> callbacks for aborting a slave/target operation, of which only one is
> populated, while spi_{slave,target}_abort() check and use only one,
> which may be the unpopulated one.
> 
> Fix this by merging the slave/target abort callbacks into a single
> callback using a union, like is already done for the slave/target flags.
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: Merge spi_controller.{slave,target}_abort()
      commit: 6c6871cdaef96361f6b79a3e45d451a6475df4d6

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
diff mbox series

Patch

diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 27680bf02c6a221c..78c35ac1ef2f2b7e 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -655,8 +655,10 @@  struct spi_controller {
 			       struct spi_message *message);
 	int (*unprepare_message)(struct spi_controller *ctlr,
 				 struct spi_message *message);
-	int (*slave_abort)(struct spi_controller *ctlr);
-	int (*target_abort)(struct spi_controller *ctlr);
+	union {
+		int (*slave_abort)(struct spi_controller *ctlr);
+		int (*target_abort)(struct spi_controller *ctlr);
+	};
 
 	/*
 	 * These hooks are for drivers that use a generic implementation