skyrocknroll / CH341SER_LINUX

nodemcu esp8266 serial linux driver with latest kernel support ubuntu 16.04
29 stars 20 forks source link

error: initialization of ‘void (*)(struct usb_serial_port *)’ from incompatible pointer type ‘int (*)(struct usb_serial_port *)’ #2

Open Goltergaul opened 1 year ago

Goltergaul commented 1 year ago

Hi I'm getting this error on ubuntu Ubuntu 22.04.1 LTS running the 5.15.0-53-generic kernel. Seems like something changed here?

sudo make
make -C /lib/modules/5.15.0-53-generic/build  M=/home/dominik/CH341SER_LINUX  
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-53-generic'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0
  You are using:           gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
  CC [M]  /home/dominik/CH341SER_LINUX/ch34x.o
/home/dominik/CH341SER_LINUX/ch34x.c:570:30: error: initialization of ‘void (*)(struct usb_serial_port *)’ from incompatible pointer type ‘int (*)(struct usb_serial_port *)’ [-Werror=incompatible-pointer-types]
  570 |         .port_remove       = ch341_port_remove,
      |                              ^~~~~~~~~~~~~~~~~
/home/dominik/CH341SER_LINUX/ch34x.c:570:30: note: (near initialization for ‘ch341_device.port_remove’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:297: /home/dominik/CH341SER_LINUX/ch34x.o] Error 1
make[1]: *** [Makefile:1903: /home/dominik/CH341SER_LINUX] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-53-generic'
make: *** [Makefile:5: default] Error 2
Turtoise1 commented 1 year ago

Same here. Using Ubuntu 22.10. Exact same error while executing sudo make and sudo make load just gives a lot of errors afterwards.