mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
tty: wch: Fix build for Linux v6.8
In Linux v6.8, the argument for the struct tty_operations::send_xchar
function was updated from char to u8 and this breaks the build for the
'wch' driver. Add a test to the conftest script to detect the argument
type for this function and use the definition generated to fix the build
for the 'wch' driver.
Bug 4448428
Change-Id: I051861cf76e56cacb4b33053d4e6644265552df7
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3057714
(cherry picked from commit 3f5ba8f70b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3032444
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
93360eb080
commit
293c8e7b85
@@ -59,7 +59,11 @@ static int ser_put_char(struct tty_struct *, unsigned char);
|
|||||||
static void ser_flush_chars(struct tty_struct *);
|
static void ser_flush_chars(struct tty_struct *);
|
||||||
static unsigned int ser_chars_in_buffer(struct tty_struct *tty);
|
static unsigned int ser_chars_in_buffer(struct tty_struct *tty);
|
||||||
static void ser_flush_buffer(struct tty_struct *);
|
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);
|
static void ser_send_xchar(struct tty_struct *, char);
|
||||||
|
#endif
|
||||||
static void ser_throttle(struct tty_struct *);
|
static void ser_throttle(struct tty_struct *);
|
||||||
static void ser_unthrottle(struct tty_struct *);
|
static void ser_unthrottle(struct tty_struct *);
|
||||||
static int ser_get_info(struct ser_state *, struct serial_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)
|
static void ser_send_xchar(struct tty_struct *tty, char ch)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
struct ser_state *state = NULL;
|
struct ser_state *state = NULL;
|
||||||
struct ser_port *port = NULL;
|
struct ser_port *port = NULL;
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += spi_get_chipselect
|
|||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tc_taprio_qopt_offload_struct_has_cmd
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tc_taprio_qopt_offload_struct_has_cmd
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tegra_dev_iommu_get_stream_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 += 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_write_has_u8_ptr_arg
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_set_termios_has_const_ktermios_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
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ufs_hba_variant_ops_suspend_has_status_arg
|
||||||
|
|||||||
@@ -7577,6 +7577,25 @@ compile_test() {
|
|||||||
compile_check_conftest "$CODE" "NV_TEGRA_DEV_IOMMU_GET_STREAM_ID_PRESENT" "" "functions"
|
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 <linux/tty.h>
|
||||||
|
#include <linux/tty_driver.h>
|
||||||
|
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)
|
tty_operations_struct_write_has_u8_ptr_arg)
|
||||||
#
|
#
|
||||||
# Determine if the function write() of tty_operations has u8 type pointer argument.
|
# Determine if the function write() of tty_operations has u8 type pointer argument.
|
||||||
|
|||||||
Reference in New Issue
Block a user