Error compiling on Fedora 40 - mismatched pointer assignment
- Are you using the latest driver?
- Are you using the latest EVDI version?
- If you are using a DisplayLink device, have you checked 'troubleshooting' on DisplayLink's website?
- Is this issue related to evdi/kernel?
- Fedora 40
- 6.10.3-200.fc40.x86_64
- n/a
- n/a
Latest pull commit eab561a9fe19d1bbc801dd1ec60e8b3318941be7 produces error: /evdi/module/evdi_platform_drv.o /home/ghester/src/evdi/module/evdi_platform_drv.c:205:19: error: initialization of ‘int (*)(struct platform_device )’ from incompatible pointer type ‘void ()(struct platform_device *)’ [-Wincompatible-pointer-types] 205 | .remove = evdi_platform_device_remove, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /evdi/module/evdi_platform_drv.c:205:19: note: (near initialization for ‘evdi_platform_driver.remove’)
This is because the kernel requires the remove function that returns void. In this case, the remove_new member should be used to receive the function pointer returning void. This is corrected with the following patch:
diff --git a/module/evdi_platform_drv.c b/module/evdi_platform_drv.c
index 8233e79..3a2cc75 100644
--- a/module/evdi_platform_drv.c
+++ b/module/evdi_platform_drv.c
@@ -202,7 +202,11 @@ unsigned int evdi_platform_device_count(struct device *device)
static struct platform_driver evdi_platform_driver = {
.probe = evdi_platform_device_probe,
+#if KERNEL_VERSION(6, 10, 0) >= LINUX_VERSION_CODE
.remove = evdi_platform_device_remove,
+#else
+ .remove_new = evdi_platform_device_remove,
+#endif
.driver = {
.name = DRIVER_NAME,
Duplicate of #461
Closing since Duplicate https://github.com/DisplayLink/evdi/issues/461 is also closed. If still happens please raise it against 1.14.8