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 pop os 21.10 with kernal 5.16.15 #8

Open magdymawad opened 2 years ago

magdymawad 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[1]: Entering directory '/usr/src/linux-headers-5.16.15-76051615-generic'
  CC [M]  /home/maz/driver/ch343.o
/home/maz/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/maz/driver/ch343.c:1684:33: note: (near initialization for ‘ch343_ops.write_room’)
/home/maz/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/maz/driver/ch343.c:1686:33: note: (near initialization for ‘ch343_ops.chars_in_buffer’)
/home/maz/driver/ch343.c: In function ‘ch343_init’:
/home/maz/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/maz/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/maz/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
GreatestCapacity commented 2 years ago

I've changed the code to make it compatible with the new Linux kernel. See the last opening pull request or clone the project that I cloned from this.

SoldierJazz commented 2 years ago

Good job, we will check it.