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

Make execution failing on Raspbian kernel 6.1.0-rpi4-rpi-v7 #4

Open Gabao-Farias opened 9 months ago

Gabao-Farias commented 9 months ago

Catching error on running make on Raspbian kernel 6.1.0-rpi4-rpi-v7, still, when trying to make in the 5.4.0-88-generic Kernel, all goes fine...

Output

make -C /lib/modules/6.1.0-rpi4-rpi-v7/build M=/home/usinasolar/repos/driver/xr-usb-serial
make[1]: Entering directory '/usr/src/linux-headers-6.1.0-rpi4-rpi-v7'
  CC [M]  /home/usinasolar/repos/driver/xr-usb-serial/xr_usb_serial_common.o
/home/usinasolar/repos/driver/xr-usb-serial/xr_usb_serial_common.c:1918:33: 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/usinasolar/repos/driver/xr-usb-serial/xr_usb_serial_common.c:1918:33: note: (near initialization for ‘xr_usb_serial_ops.write_room’)
/home/usinasolar/repos/driver/xr-usb-serial/xr_usb_serial_common.c:1922:33: 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/usinasolar/repos/driver/xr-usb-serial/xr_usb_serial_common.c:1922:33: note: (near initialization for ‘xr_usb_serial_ops.chars_in_buffer’)
/home/usinasolar/repos/driver/xr-usb-serial/xr_usb_serial_common.c:1924:33: error: initialization of ‘void (*)(struct tty_struct *, const struct ktermios *)’ from incompatible pointer type ‘void (*)(struct tty_struct *, struct ktermios *)’ [-Werror=incompatible-pointer-types]
 1924 |         .set_termios =          xr_usb_serial_tty_set_termios,
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/usinasolar/repos/driver/xr-usb-serial/xr_usb_serial_common.c:1924:33: note: (near initialization for ‘xr_usb_serial_ops.set_termios’)
/home/usinasolar/repos/driver/xr-usb-serial/xr_usb_serial_common.c: In function ‘xr_usb_serial_init’:
/home/usinasolar/repos/driver/xr-usb-serial/xr_usb_serial_common.c:1936:36: 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/usinasolar/repos/driver/xr-usb-serial/xr_usb_serial_common.c:1936:34: 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/usinasolar/repos/driver/xr-usb-serial/xr_usb_serial_common.c:1953:17: 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
make[2]: *** [/usr/src/linux-headers-6.1.0-rpi4-common-rpi/scripts/Makefile.build:255: /home/usinasolar/repos/driver/xr-usb-serial/xr_usb_serial_common.o] Error 1
make[1]: *** [/usr/src/linux-headers-6.1.0-rpi4-common-rpi/Makefile:2039: /home/usinasolar/repos/driver/xr-usb-serial] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.1.0-rpi4-rpi-v7'
make: *** [Makefile:9: all] Error 2

Also, tryed...

CFLAGS="-Wno-error=implicit-function-declaration"

...but no success so far.

Any ideia about what could be happening or any workaround? 🤔

rucoder commented 3 months ago

@Gabao-Farias My PR https://github.com/enlyze/xr-usb-serial/pull/5 should fix this problem

Freax13 commented 2 months ago

Any ideia about what could be happening or any workaround? 🤔

The kernel changes the signatures of its data types occasionally and the drivers must be adjusted for this. In order to fix this, one would have to compare the correct signatures in the kernel with what's contained in this driver and change the driver accordingly.

@Gabao-Farias My PR #5 should fix this problem

Those errors look unrelated.

Freax13 commented 2 months ago

https://github.com/enlyze/xr-usb-serial/commit/c29ea96ab7a0e8bbe279f5d8fdc48841626fcee7 might help.