WCHSoftGroup / ch343ser_linux

USB driver for USB to serial chip ch342, ch343, ch344, ch9101, ch9102, ch9103, etc
125 stars 46 forks source link

compilation error on archlinux with kernel 5.17.5-zen1 #10

Open Diogoflsilva opened 2 years ago

Diogoflsilva commented 2 years ago

I have an esp32 with ch9102x chip so I looked for a driver and found this repo but I'm not sure why I'm getting this compilation error if you could please help me out that'd be great

make -C /lib/modules/5.17.5-zen1-1-zen/build M=/home/silva/git/ch343ser_linux/driver
make[1]: Entering directory '/usr/lib/modules/5.17.5-zen1-1-zen/build' CC [M] /home/silva/git/ch343ser_linux/driver/ch343.o /home/silva/git/ch343ser_linux/driver/ch343.c:1684:33: error: initialization of ‘unsigned int ()(struct tty_struct )’ from incompatible pointer type ‘int ()(struct tty_struct )’ [-Werror=incompatible-pointer-types] 1684 | .write_room = ch343_tty_write_room, | ^~~~~~~~ /home/silva/git/ch343ser_linux/driver/ch343.c:1684:33: note: (near initialization for ‘ch343_ops.write_room’) /home/silva/git/ch343ser_linux/driver/ch343.c:1686:33: error: initialization of ‘unsigned int ()(struct tty_struct )’ from incompatible pointer type ‘int ()(struct tty_struct )’ [-Werror=incompatible-pointer-types] 1686 | .chars_in_buffer = ch343_tty_chars_in_buffer, | ^~~~~~~~~ /home/silva/git/ch343ser_linux/driver/ch343.c:1686:33: note: (near initialization for ‘ch343_ops.chars_in_buffer’) /home/silva/git/ch343ser_linux/driver/ch343.c: In function ‘ch343_init’: /home/silva/git/ch343ser_linux/driver/ch343.c:1699:28: error: implicit declaration of function ‘alloc_tty_driver’ [-Werror=implicit-function-declaration] 1699 | ch343_tty_driver = alloc_tty_driver(CH343_TTY_MINORS); | ^~~~ /home/silva/git/ch343ser_linux/driver/ch343.c:1699:26: warning: assignment to ‘struct tty_driver *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion] 1699 | ch343_tty_driver = alloc_tty_driver(CH343_TTY_MINORS); | ^ /home/silva/git/ch343ser_linux/driver/ch343.c:1716:17: error: implicit declaration of function ‘put_tty_driver’ [-Werror=implicit-function-declaration] 1716 | put_tty_driver(ch343_tty_driver); | ^~~~~~ cc1: some warnings being treated as errors make[2]: [scripts/Makefile.build:288: /home/silva/git/ch343ser_linux/driver/ch343.o] Error 1 make[1]: [Makefile:1826: /home/silva/git/ch343ser_linux/driver] Error 2 make[1]: Leaving directory '/usr/lib/modules/5.17.5-zen1-1-zen/build' make: *** [Makefile:5: default] Error 2

GreatestCapacity commented 2 years ago

Change the function name: alloc_tty_driver -> tty_alloc_driver put_tty_driver -> tty_driver_kref_put

Or

Clone from this: https://github.com/GreatestCapacity/ch343ser_linux

I've submit a pull request to this project, but not be approved yet.

taotieren commented 1 year ago

https://aur.archlinux.org/packages/ch343ser-dkms-git