Small changes, the "upstream" doesn't look to be maintained anymore,
so if we get any more breaks it might be time to remove this recipe.

Signed-off-by: Andrew Davis <[email protected]>
---
 .../0001-Support-Linux-kernels-v5.15.patch    | 41 +++++++++++++++++++
 .../gdbc6x/gdbserverproxy-module-drv_git.bb   |  2 +
 2 files changed, 43 insertions(+)
 create mode 100644 
meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv/0001-Support-Linux-kernels-v5.15.patch

diff --git 
a/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv/0001-Support-Linux-kernels-v5.15.patch
 
b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv/0001-Support-Linux-kernels-v5.15.patch
new file mode 100644
index 00000000..108a7081
--- /dev/null
+++ 
b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv/0001-Support-Linux-kernels-v5.15.patch
@@ -0,0 +1,41 @@
+From 7e6e1312629f9bc7a24871f7f395f2d288a1758f Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Tue, 18 Apr 2023 11:38:54 -0500
+Subject: [PATCH] Support Linux kernels v5.15+
+
+put_tty_driver was removed and write_room return type has changed.
+
+Function tty_driver_kref_put has been around a while, so no need
+to do a kernel version check.
+
+Upstream-Status: Pending
+Signed-off-by: Andrew Davis <[email protected]>
+---
+ kernel_module/gdbproxy-mod/gdbserverproxy.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/kernel_module/gdbproxy-mod/gdbserverproxy.c 
b/kernel_module/gdbproxy-mod/gdbserverproxy.c
+index 418b6db..4b1c676 100644
+--- a/kernel_module/gdbproxy-mod/gdbserverproxy.c
++++ b/kernel_module/gdbproxy-mod/gdbserverproxy.c
+@@ -540,7 +540,11 @@ static int gdb_write(struct tty_struct *tty,
+  * 
+  *
+  */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0))
++static unsigned int gdb_write_room(struct tty_struct *tty)
++#else
+ static int gdb_write_room(struct tty_struct *tty)
++#endif
+ {
+      return GDB_STR_SIZE;
+ }
+@@ -914,7 +918,7 @@ static int __init gdb_dev_init(void)
+      if (ret < 0) {
+ 
+           printk(KERN_ERR "Couldn't register gdbtty driver.\n");
+-          put_tty_driver(tty_gdb_driver);
++          tty_driver_kref_put(tty_gdb_driver);
+           return ret;
+      }
+ 
diff --git 
a/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv_git.bb 
b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv_git.bb
index cb9e4c24..60492f81 100644
--- a/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv_git.bb
+++ b/meta-ti-extras/recipes-devtools/gdbc6x/gdbserverproxy-module-drv_git.bb
@@ -7,6 +7,8 @@ MACHINE_KERNEL_PR:append = "b"
 PR = "${MACHINE_KERNEL_PR}"
 PV:append = "+git${SRCPV}"
 
+SRC_URI:append = " 
file://0001-Support-Linux-kernels-v5.15.patch;patchdir=../.."
+
 S = "${WORKDIR}/git/kernel_module/gdbproxy-mod"
 
 inherit module
-- 
2.39.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#16407): 
https://lists.yoctoproject.org/g/meta-ti/message/16407
Mute This Topic: https://lists.yoctoproject.org/mt/98348785/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-ti/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to