diff mbox series

[46/75] patches: Handle changed spi_driver->remove signature

Message ID 20240627234808.1253337-47-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to kernel 6.1.95 | expand

Commit Message

Hauke Mehrtens June 27, 2024, 11:47 p.m. UTC
The return type was changed from int to void. Create an spatch to handle
this change.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 patches/0108-spi-probe.cocci | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 patches/0108-spi-probe.cocci
diff mbox series

Patch

diff --git a/patches/0108-spi-probe.cocci b/patches/0108-spi-probe.cocci
new file mode 100644
index 00000000..35c32e26
--- /dev/null
+++ b/patches/0108-spi-probe.cocci
@@ -0,0 +1,27 @@ 
+@r@
+identifier OPS;
+identifier spi_driver_remove;
+fresh identifier spi_driver_remove_wrap = "bp_" ## spi_driver_remove;
+position p;
+@@
+struct spi_driver OPS@p = {
++#if LINUX_VERSION_IS_GEQ(5,18,0)
+	.remove = spi_driver_remove,
++#else
++	.remove = spi_driver_remove_wrap,
++#endif
+};
+
+@@
+identifier r.spi_driver_remove_wrap;
+identifier r.spi_driver_remove;
+@@
+void spi_driver_remove(...) {...}
++#if LINUX_VERSION_IS_LESS(5,18,0)
++static int spi_driver_remove_wrap(struct spi_device *spi)
++{
++	spi_driver_remove(spi);
++
++	return 0;
++}
++#endif