enlyze / xr-usb-serial

Linux driver for the Exar/MaxLinear XR21V1410, XR21V1412, XR21V1414, XR21B1411, XR21B1420, XR21B1422, XR21B1424, XR22801, XR22802, XR22804
7 stars 3 forks source link

Doesn't compile on newer Linux kernel #3

Open rbalik opened 1 year ago

rbalik commented 1 year ago

Building on kernel 5.15.84

We get this output. Sounds like some of these functions were changed in the newer kernel

/home/pi/xr-usb-serial-master/xr_usb_serial_common.c:1918:17: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
 1918 |  .write_room =  xr_usb_serial_tty_write_room,
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/xr-usb-serial-master/xr_usb_serial_common.c:1918:17: note: (near initialization for ‘xr_usb_serial_ops.write_room’)
/home/pi/xr-usb-serial-master/xr_usb_serial_common.c:1922:21: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
 1922 |  .chars_in_buffer = xr_usb_serial_tty_chars_in_buffer,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/xr-usb-serial-master/xr_usb_serial_common.c:1922:21: note: (near initialization for ‘xr_usb_serial_ops.chars_in_buffer’)
/home/pi/xr-usb-serial-master/xr_usb_serial_common.c: In function ‘xr_usb_serial_init’:
/home/pi/xr-usb-serial-master/xr_usb_serial_common.c:1936:29: error: implicit declaration of function ‘alloc_tty_driver’ [-Werror=implicit-function-declaration]
 1936 |  xr_usb_serial_tty_driver = alloc_tty_driver(XR_USB_SERIAL_TTY_MINORS);
      |                             ^~~~~~~~~~~~~~~~
/home/pi/xr-usb-serial-master/xr_usb_serial_common.c:1936:27: warning: assignment to ‘struct tty_driver *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
 1936 |  xr_usb_serial_tty_driver = alloc_tty_driver(XR_USB_SERIAL_TTY_MINORS);
      |                           ^
/home/pi/xr-usb-serial-master/xr_usb_serial_common.c:1953:3: error: implicit declaration of function ‘put_tty_driver’ [-Werror=implicit-function-declaration]
 1953 |   put_tty_driver(xr_usb_serial_tty_driver);
      |   ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
ColinFinck commented 1 year ago

As of now, this repo is only targeting the long-term 5.4.x kernel series. A fix for 5.15.x has been generously provided by @valinet in #2

ccera-astro commented 9 months ago

Ubuntu 22.04 is currently shipping 6.2.0 kernels. Anyone know if the PR from @valinet will apply?

Freax13 commented 2 months ago

Has this been fixed by https://github.com/enlyze/xr-usb-serial/commit/c29ea96ab7a0e8bbe279f5d8fdc48841626fcee7

rany2 commented 1 month ago

Works fine for me on 6.6, thanks for maintaining this!

rany2 commented 3 weeks ago

BTW this module isn't needed on 6.8 onwards.