From fa3fe0413fb6910aa6b983a4ea86237f64010ae5 Mon Sep 17 00:00:00 2001 From: Ryan Eatmon Date: Fri, 4 Oct 2024 10:18:57 -0500 Subject: debugss-module-drv: Add patch for kernel 6.11 change There was a change to the return value for a function pointer in the kernel v6.11. This patch adapts the module to the kernel change. Signed-off-by: Ryan Eatmon --- .../recipes-bsp/dsptop/debugss-module-drv_git.bb | 5 +- ...dule-kernel-6.11-changed-return-value-for.patch | 57 ++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 meta-ti-extras/recipes-bsp/dsptop/files/0002-debugss_kmodule-kernel-6.11-changed-return-value-for.patch diff --git a/meta-ti-extras/recipes-bsp/dsptop/debugss-module-drv_git.bb b/meta-ti-extras/recipes-bsp/dsptop/debugss-module-drv_git.bb index 81e544f7..74ceed9d 100644 --- a/meta-ti-extras/recipes-bsp/dsptop/debugss-module-drv_git.bb +++ b/meta-ti-extras/recipes-bsp/dsptop/debugss-module-drv_git.bb @@ -18,4 +18,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" include dsptop.inc -SRC_URI += "file://0001-debugss_kmodule-Add-include-for-mod_devicetable.h.patch" +SRC_URI += "\ + file://0001-debugss_kmodule-Add-include-for-mod_devicetable.h.patch \ + file://0002-debugss_kmodule-kernel-6.11-changed-return-value-for.patch \ +" diff --git a/meta-ti-extras/recipes-bsp/dsptop/files/0002-debugss_kmodule-kernel-6.11-changed-return-value-for.patch b/meta-ti-extras/recipes-bsp/dsptop/files/0002-debugss_kmodule-kernel-6.11-changed-return-value-for.patch new file mode 100644 index 00000000..0afe0264 --- /dev/null +++ b/meta-ti-extras/recipes-bsp/dsptop/files/0002-debugss_kmodule-kernel-6.11-changed-return-value-for.patch @@ -0,0 +1,57 @@ +From aaddf1fa8b92db23ae2ebc83826c2bb5f5c87c35 Mon Sep 17 00:00:00 2001 +From: Ryan Eatmon +Date: Thu, 3 Oct 2024 14:25:18 -0500 +Subject: [PATCH] debugss_kmodule: kernel 6.11 changed return value for remove + slot + +In kernel version 6.11 the function footprint changed for the remove +slot to return a void instead of an int. [1] + +Add ifdef checking code to look for kernel version and pick the correct +return code. + +[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/platform_device.h?id=0edb555a65d1ef047a9805051c36922b52a38a9d + +Upstream-Status: Inactive-Upstream [lastcommit: 2021-04-20] + +Signed-off-by: Ryan Eatmon +--- + debugss_kmodule.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/debugss_kmodule.c b/debugss_kmodule.c +index 9e084eb..4191be8 100644 +--- a/debugss_kmodule.c ++++ b/debugss_kmodule.c +@@ -27,6 +27,7 @@ + #include "debugss_kmodule.h" + + #include ++#include + + /* un-comment the line below to enable printing for kernel debug messages */ + //#define DEBUGSS_DRV_DEBUG +@@ -1132,7 +1133,11 @@ static int dra7xx_debugss_probe(struct platform_device *pdev) + return retval; + } + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)) + static int dra7xx_debugss_remove(struct platform_device *pdev) ++#else ++static void dra7xx_debugss_remove(struct platform_device *pdev) ++#endif + { + __D("%s:\n",__FUNCTION__); + +@@ -1145,7 +1150,9 @@ static int dra7xx_debugss_remove(struct platform_device *pdev) + /* Un-prepare debugSS clock */ + clk_disable_unprepare(sys_clk_in1); + ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)) + return 0; ++#endif + } + + static const struct of_device_id dra7xx_debugss_of_match[] = { +-- +2.17.1 -- cgit v1.2.3-54-g00ecf