Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling on Fedora 40 - mismatched pointer assignment #488

Open
codefool opened this issue Aug 13, 2024 · 1 comment
Open

Error compiling on Fedora 40 - mismatched pointer assignment #488

codefool opened this issue Aug 13, 2024 · 1 comment

Comments

@codefool
Copy link

codefool commented Aug 13, 2024

  • 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 eab561a 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,
@maclermo
Copy link

Duplicate of #461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants