Open ewe2 opened 2 years ago
Got the same error, Ubuntu 20.04
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-46-generic'
CC [M] /home/milton/WorkC/ch341ser_linux/driver/ch341.o
/home/milton/WorkC/ch341ser_linux/driver/ch341.c:1607:16: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
1607 | .write_room = ch341_tty_write_room,
| ^~~~~~~~~~~~~~~~~~~~
/home/milton/WorkC/ch341ser_linux/driver/ch341.c:1607:16: note: (near initialization for ‘ch341_ops.write_room’)
/home/milton/WorkC/ch341ser_linux/driver/ch341.c:1609:21: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
1609 | .chars_in_buffer = ch341_tty_chars_in_buffer,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/milton/WorkC/ch341ser_linux/driver/ch341.c:1609:21: note: (near initialization for ‘ch341_ops.chars_in_buffer’)
/home/milton/WorkC/ch341ser_linux/driver/ch341.c: In function ‘ch341_init’:
/home/milton/WorkC/ch341ser_linux/driver/ch341.c:1623:21: error: implicit declaration of function ‘alloc_tty_driver’ [-Werror=implicit-function-declaration]
1623 | ch341_tty_driver = alloc_tty_driver(CH341_TTY_MINORS);
| ^~~~~~~~~~~~~~~~
/home/milton/WorkC/ch341ser_linux/driver/ch341.c:1623:19: warning: assignment to ‘struct tty_driver *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
1623 | ch341_tty_driver = alloc_tty_driver(CH341_TTY_MINORS);
| ^
/home/milton/WorkC/ch341ser_linux/driver/ch341.c:1640:3: error: implicit declaration of function ‘put_tty_driver’ [-Werror=implicit-function-declaration]
1640 | put_tty_driver(ch341_tty_driver);
| ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:297: /home/milton/WorkC/ch341ser_linux/driver/ch341.o] Error 1
make[1]: *** [Makefile:1881: /home/milton/WorkC/ch341ser_linux/driver] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-46-generic'
make: *** [Makefile:5: default] Error 2
Kernel info
$ uname -a
Linux milton 5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
make[1]: Entering directory '/usr/src/linux-headers-5.16.0-5mx-amd64' /bin/sh: 1: /usr/src/linux-headers-5.16.0-5mx-common/scripts/pahole-flags.sh: not found /bin/sh: 1: /usr/src/linux-headers-5.16.0-5mx-common/scripts/pahole-flags.sh: not found /bin/sh: 1: /usr/src/linux-headers-5.16.0-5mx-common/scripts/pahole-flags.sh: not found CC [M] /ch341/ch341ser_linux/driver/ch341.o ch341/ch341ser_linux/driver/ch341.c:1607:16: error: initialization of ‘unsigned int ()(struct tty_struct )’ from incompatible pointer type ‘int ()(struct tty_struct )’ [-Werror=incompatible-pointer-types] 1607 | .write_room = ch341_tty_write_room, | ^
~~~~~~~ /ch341/ch341ser_linux/driver/ch341.c:1607:16: note: (near initialization for ‘ch341_ops.write_room’) /ch341ser_linux/driver/ch341.c:1609:21: error: initialization of ‘unsigned int ()(struct tty_struct )’ from incompatible pointer type ‘int ()(struct tty_struct )’ [-Werror=incompatible-pointer-types] 1609 | .chars_in_buffer = ch341_tty_chars_in_buffer, | ^~~~~~~~~ /ch341/ch341ser_linux/driver/ch341.c:1609:21: note: (near initialization for ‘ch341_ops.chars_in_buffer’) /ch341/ch341ser_linux/driver/ch341.c: In function ‘ch341_init’: /ch341/ch341ser_linux/driver/ch341.c:1623:21: error: implicit declaration of function ‘alloc_tty_driver’ [-Werror=implicit-function-declaration] 1623 | ch341_tty_driver = alloc_tty_driver(CH341_TTY_MINORS); | ^~~~/ch341/ch341ser_linux/driver/ch341.c:1623:19: warning: assignment to ‘struct tty_driver *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 1623 | ch341_tty_driver = alloc_tty_driver(CH341_TTY_MINORS); | ^ /ch341/ch341ser_linux/driver/ch341.c:1640:3: error: implicit declaration of function ‘put_tty_driver’ [-Werror=implicit-function-declaration] 1640 | put_tty_driver(ch341_tty_driver); | ^~~~~~ cc1: some warnings being treated as errors make[2]: [/usr/src/linux-headers-5.16.0-5mx-common/scripts/Makefile.build:292: /ch341ser_linux/driver/ch341.o] Error 1 make[1]: [/usr/src/linux-headers-5.16.0-5mx-common/Makefile:1870: /ch341/ch341ser_linux/driver] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-5.16.0-5mx-amd64' make: *** [Makefile:5: default] Error 2Looks like you need to update your driver a bit more? System is Mx Linux a Debian-based distro Linux marvin 5.16.0-5mx-amd64 #1 SMP PREEMPT Debian 5.16.14-1~mx21+1 (2022-03-22) x86_64 GNU/Linux gcc (Debian 10.2.1-6) 10.2.1 20210110
Any other questions you have, happy to answer.