Skip to content

Doesn't compile on newer Linux kernel #3

@rbalik

Description

@rbalik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions