diff --git a/drivers/tty/serial/wch_35x/wch_serial.c b/drivers/tty/serial/wch_35x/wch_serial.c index 0ae0b53f..b01b0de7 100644 --- a/drivers/tty/serial/wch_35x/wch_serial.c +++ b/drivers/tty/serial/wch_35x/wch_serial.c @@ -60,7 +60,11 @@ static int ser_put_char(struct tty_struct *, unsigned char); static void ser_flush_chars(struct tty_struct *); static unsigned int ser_chars_in_buffer(struct tty_struct *tty); static void ser_flush_buffer(struct tty_struct *); +#if defined(NV_TTY_OPERATIONS_STRUCT_SEND_XCHAR_HAS_U8_ARG) /* Linux 6.8 */ +static void ser_send_xchar(struct tty_struct *, u8); +#else static void ser_send_xchar(struct tty_struct *, char); +#endif static void ser_throttle(struct tty_struct *); static void ser_unthrottle(struct tty_struct *); static int ser_get_info(struct ser_state *, struct serial_struct *); @@ -692,7 +696,11 @@ static void ser_flush_buffer(struct tty_struct *tty) } } +#if defined(NV_TTY_OPERATIONS_STRUCT_SEND_XCHAR_HAS_U8_ARG) /* Linux 6.8 */ +static void ser_send_xchar(struct tty_struct *tty, u8 ch) +#else static void ser_send_xchar(struct tty_struct *tty, char ch) +#endif { struct ser_state *state = NULL; struct ser_port *port = NULL; diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index e215e1ea..00ebb3ec 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -151,6 +151,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += tc_taprio_qopt_offload_struct_has_cmd NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra264_chip_id NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_dev_iommu_get_stream_id NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_ivc_struct_has_iosys_map +NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_send_xchar_has_u8_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_write_has_u8_ptr_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_set_termios_has_const_ktermios_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += ufs_hba_variant_ops_suspend_has_status_arg diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 90437ade..fbead866 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -7491,6 +7491,25 @@ compile_test() { compile_check_conftest "$CODE" "NV_TEGRA_DEV_IOMMU_GET_STREAM_ID_PRESENT" "" "functions" ;; + tty_operations_struct_send_xchar_has_u8_arg) + # + # Determine if the struct tty_operations::send_xchar argument is of type u8. + # + # Commit 3a00da027946 ("tty: make tty_operations::send_xchar accept u8 char") + # updated the argument for tty_operations::send_xchar from char to u8 in Linux + # v6.8. + # + CODE=" + #include + #include + static inline void conftest_send_xchar(struct tty_struct *ttys, u8 ch) {} + static struct tty_operations tty_ops = { + .send_xchar = conftest_send_xchar, + };" + + compile_check_conftest "$CODE" "NV_TTY_OPERATIONS_STRUCT_SEND_XCHAR_HAS_U8_ARG" "" "types" + ;; + tty_operations_struct_write_has_u8_ptr_arg) # # Determine if the function write() of tty_operations has u8 type pointer argument.