1From 99ae2a39ddc3f89c66d9f09783b591c0f2dbf2e9 Mon Sep 17 00:00:00 2001
2From: Gaurav Jain <gaurav.jain@nxp.com>
3Date: Wed, 28 Jun 2023 12:44:32 +0530
4Subject: [PATCH] cryptodev_verbosity: Fix build for Linux 6.4
5
6register_sysctl_table api is removed in kernel.
7migrate to the new api register_sysctl.
8
9child is also removed in linux 6.4 ctl_table struct.
10
11Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com>
12
13Upstream: https://github.com/cryptodev-linux/cryptodev-linux/commit/99ae2a39ddc3f89c66d9f09783b591c0f2dbf2e9
14Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
15---
16 ioctl.c | 6 ++++++
17 1 file changed, 6 insertions(+)
18
19diff --git a/ioctl.c b/ioctl.c
20index 8f241b86..4262bbd5 100644
21--- a/ioctl.c
22+++ b/ioctl.c
23@@ -1246,7 +1246,9 @@ static struct ctl_table verbosity_ctl_root[] = {
24 	{
25 		.procname       = "ioctl",
26 		.mode           = 0555,
27+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
28 		.child          = verbosity_ctl_dir,
29+#endif
30 	},
31 	{},
32 };
33@@ -1267,7 +1269,11 @@ static int __init init_cryptodev(void)
34 		return rc;
35 	}
36
37+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0))
38 	verbosity_sysctl_header = register_sysctl_table(verbosity_ctl_root);
39+#else
40+	verbosity_sysctl_header = register_sysctl(verbosity_ctl_root->procname, verbosity_ctl_dir);
41+#endif
42
43 	pr_info(PFX "driver %s loaded.\n", VERSION);
44
45